hash stringlengths 40 40 | diff stringlengths 131 26.7k | message stringlengths 7 694 | project stringlengths 5 67 | split stringclasses 1 value | diff_languages stringlengths 2 24 |
|---|---|---|---|---|---|
434bb480c18b86d7d86020a4d9004d87096a073c | diff --git a/tests/Configurator/UrlConfigTest.php b/tests/Configurator/UrlConfigTest.php
index <HASH>..<HASH> 100644
--- a/tests/Configurator/UrlConfigTest.php
+++ b/tests/Configurator/UrlConfigTest.php
@@ -36,7 +36,7 @@ class UrlConfigTest extends Test
}
/**
- * @requires extension intl
+ * @requires function idn_to_ascii
* @testdox Disallowed IDNs are punycoded
*/
public function testDisallowedIDNsArePunycoded()
diff --git a/tests/Plugins/Autolink/ParserTest.php b/tests/Plugins/Autolink/ParserTest.php
index <HASH>..<HASH> 100644
--- a/tests/Plugins/Autolink/ParserTest.php
+++ b/tests/Plugins/Autolink/ParserTest.php
@@ -79,7 +79,7 @@ class ParserTest extends Test
[],
function ()
{
- if (!extension_loaded('intl'))
+ if (!function_exists('idn_to_ascii'))
{
$this->markTestSkipped('idn_to_ascii() is required.');
} | Replaced checks for intl extension with checks for idn_to_ascii() in tests | s9e_TextFormatter | train | php,php |
057c5cf74308a0dc6382946c05024e4651d3074f | diff --git a/lib/doggy/cli/push.rb b/lib/doggy/cli/push.rb
index <HASH>..<HASH> 100644
--- a/lib/doggy/cli/push.rb
+++ b/lib/doggy/cli/push.rb
@@ -2,11 +2,20 @@
module Doggy
class CLI::Push
+ WARNING_MESSAGE = "You are about to force push all the objects. "\
+ "This will override changes in Datadog if they have not been sycned to the dog repository. "\
+ "Do you want to proceed?(Y/N)"
+
def initialize(options)
@options = options
end
def run
+ if @options['all_objects'] && !Doggy.ui.yes?(WARNING_MESSAGE)
+ Doggy.ui.say "Operation cancelled"
+ return
+ end
+
push_resources('dashboards', Models::Dashboard) if @options['dashboards']
push_resources('monitors', Models::Monitor) if @options['monitors']
push_resources('screens', Models::Screen) if @options['screens'] | configm push all action before proceeding | Shopify_doggy | train | rb |
136f3725f4f90bef566ad43b740b341f69236bc5 | diff --git a/tools/snippets/test/fixtures/python/runner.py b/tools/snippets/test/fixtures/python/runner.py
index <HASH>..<HASH> 100644
--- a/tools/snippets/test/fixtures/python/runner.py
+++ b/tools/snippets/test/fixtures/python/runner.py
@@ -12,7 +12,7 @@ from scipy import special
FILE = os.path.realpath(__file__)
# Extract the directory in which this file resides:
-DIR = os.path.dirname(file)
+DIR = os.path.dirname(FILE)
def gen(x, name): | Fix variable name in Python snippet | stdlib-js_stdlib | train | py |
2657aeff3c53e8584df640c2ced5e61dbe4054ff | diff --git a/core-bundle/src/Resources/contao/library/Contao/Search.php b/core-bundle/src/Resources/contao/library/Contao/Search.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/library/Contao/Search.php
+++ b/core-bundle/src/Resources/contao/library/Contao/Search.php
@@ -67,7 +67,7 @@ class Search
}
// Replace special characters
- $strContent = str_replace(array("\n", "\r", "\t", ' ', ' '), ' ', $arrData['content']);
+ $strContent = str_replace(array("\n", "\r", "\t", ' ', ' ', '­'), array(' ', ' ', ' ', ' ', ' ', ''), $arrData['content']);
// Strip script tags
while (($intStart = strpos($strContent, '<script')) !== false) | [Core] Strip soft hyphens when indexing a page (see #<I>). | contao_contao | train | php |
05e2cfc1acb8146353a15ca21bf0907fc57af43f | diff --git a/js/slider.js b/js/slider.js
index <HASH>..<HASH> 100644
--- a/js/slider.js
+++ b/js/slider.js
@@ -38,7 +38,7 @@
// setup
this.$slider = this.$el.find('.slides');
this.$slides = this.$slider.children('li');
- this.activeIndex = this.$slider.find('.active').index();
+ this.activeIndex = this.$slides.filter(function(item) { return $(item).hasClass('active'); }).first().index();
if (this.activeIndex != -1) {
this.$active = this.$slides.eq(this.activeIndex);
} | made slider activeIndex check more specific | Dogfalo_materialize | train | js |
a25d86c4b4447518c2ecc2cd52231b55eb73d629 | diff --git a/lib/app/dataMixin.js b/lib/app/dataMixin.js
index <HASH>..<HASH> 100644
--- a/lib/app/dataMixin.js
+++ b/lib/app/dataMixin.js
@@ -34,7 +34,7 @@ export default {
return store.siteData
},
$localeConfig () {
- const { locales } = this.$site
+ const { locales = {}} = this.$site
let targetLang
let defaultLang
Object.keys(locales).forEach(path => { | fix: ensure runnable when no locales are provided | vuejs_vuepress | train | js |
dcd9d3015613434a996c4c1b4a245ad5d26e8758 | diff --git a/src/widgets/WithWhoisProtectPosition.php b/src/widgets/WithWhoisProtectPosition.php
index <HASH>..<HASH> 100644
--- a/src/widgets/WithWhoisProtectPosition.php
+++ b/src/widgets/WithWhoisProtectPosition.php
@@ -48,19 +48,24 @@ class WithWhoisProtectPosition extends Widget
'class' => 'option-input',
'onClick' => new JsExpression(<<<"JS"
const action = (this.checked === false) ? encodeURI(this.dataset.fromcart) : encodeURI(this.dataset.tocart);
+ const overlay = document.querySelector('.invoice-overlay');
$.ajax({
url: action,
beforeSend: () => {
+ if (overlay) {
document.querySelector('.invoice-overlay').style.display = 'block';
+ }
},
success: () => {
$.ajax({
url: '' + $cartUrl,
success: cartHtml => {
$('.content section.box').replaceWith(cartHtml);
- hipanel.updateCart(() => {
- document.querySelector('.invoice-overlay').style.display = 'none';
- })
+ if (overlay) {
+ hipanel.updateCart(() => {
+ document.querySelector('.invoice-overlay').style.display = 'none';
+ });
+ }
},
});
} | Fixed JS error while client try to check Aad WHOIS Protection on the cart page | hiqdev_hipanel-module-domain | train | php |
aa8092c0c9dff466ee999fddb4897074dbdc464a | diff --git a/bin/cli.js b/bin/cli.js
index <HASH>..<HASH> 100755
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -14,7 +14,8 @@ var fs = require('fs')
, cmds
, opts
, usage
- , cmd;
+ , cmd
+ , filepath;
usage = ''
+ 'Geddy web framework for Node.js\n'
@@ -123,7 +124,11 @@ if (typeof opts.help != 'undefined') {
else {
// `geddy app foo` or `geddy resource bar` etc. -- run generators
if (cmds.length) {
- cmd = 'jake -t -f ' + __dirname + '/../Jakefile ';
+ filepath = __dirname + '/../Jakefile';
+ if (process.platform == 'win32') {
+ filepath = '"' + filepath + '"';
+ }
+ cmd = 'jake -t -f ' + filepath + ' ';
if (cmds[0] != 'secret' && !cmds[1]) {
throw new Error(cmds[0] + ' command requires another argument.');
} | Wrap Jakefile path in quotes on win<I>. | mde_ejs | train | js |
a796bc67b72c4c11f22fc1720dbb4810d990976a | diff --git a/src/Transport/StreamInsert.php b/src/Transport/StreamInsert.php
index <HASH>..<HASH> 100644
--- a/src/Transport/StreamInsert.php
+++ b/src/Transport/StreamInsert.php
@@ -57,21 +57,12 @@ class StreamInsert
$this->request->header('Transfer-Encoding', 'chunked');
$this->request->setReadFunction($callback);
- $this->request->setCallbackFunction(function (Request $request) {
- fclose($this->source);
- });
-
- $this->curlerRolling->addQueLoop($this->request);
- $this->curlerRolling->execLoopWait();
-
+ $this->curlerRolling->execOne($this->request, true);
$statement = new Statement($this->request);
$statement->error();
- } catch (\Exception $e) {
- if (is_resource($this->source)) {
- fclose($this->source);
- }
- throw $e;
+ return $statement;
+ } finally {
+ fclose($this->source);
}
- return $statement;
}
}
\ No newline at end of file | FIX: one stream work faster and safe than loop | smi2_phpClickHouse | train | php |
bf92213877116ca9240156c8e7a61e122c648d24 | diff --git a/visidata/plugins.py b/visidata/plugins.py
index <HASH>..<HASH> 100644
--- a/visidata/plugins.py
+++ b/visidata/plugins.py
@@ -112,9 +112,9 @@ class PluginsSheet(JsonLinesSheet):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()
- vd.status(out)
+ vd.status(out.decode('UTF-8'))
if err:
- vd.warning(err)
+ vd.warning(err.decode('UTF-8'))
else:
with urlcache(plugin.url, days=0).open_text() as pyfp:
contents = pyfp.read()
@@ -130,9 +130,9 @@ class PluginsSheet(JsonLinesSheet):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()
- vd.status(out)
+ vd.status(out.decode('UTF-8'))
if err:
- vd.warning(err)
+ vd.warning(err.decode('UTF-8'))
vd.status('%s plugin installed' % plugin.name)
if _plugin_in_import_list(plugin): | [plugins-] convert stdout/error from plugins install from bytes to str | saulpw_visidata | train | py |
bbb7b041b22e953cdaa314702046ed2fae1000db | diff --git a/lib/jsduck/page.rb b/lib/jsduck/page.rb
index <HASH>..<HASH> 100644
--- a/lib/jsduck/page.rb
+++ b/lib/jsduck/page.rb
@@ -53,6 +53,7 @@ module JsDuck
abstract_row("Extends:", @cls.parent ? class_link(@cls.parent.full_name) : "Object"),
abstract_row("Defind In:", file_link),
@subclasses[@cls] ? abstract_row("Subclasses:", subclasses) : "",
+ @cls[:xtype] ? abstract_row("xtype:", @cls[:xtype]) : "",
"</table>",
].join("\n")
end | Showing @xtype information in generated pages.
Strange how I forgot to add this really useful and trivial-to-implement feature. | senchalabs_jsduck | train | rb |
92b1d47bcfc735a04bd51cd83a40132de26d9176 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -84,6 +84,7 @@ setup(
url="https://github.com/aws/sagemaker-python-sdk/",
license="Apache License 2.0",
keywords="ML Amazon AWS AI Tensorflow MXNet",
+ python_requires=">= 3.6",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers", | fix: update setup.py to add minimum python requirement of <I> (#<I>) | aws_sagemaker-python-sdk | train | py |
224c813f77ed21aab69d27bb426cc47064b85585 | diff --git a/go/caddy/api/radius_attributes.go b/go/caddy/api/radius_attributes.go
index <HASH>..<HASH> 100644
--- a/go/caddy/api/radius_attributes.go
+++ b/go/caddy/api/radius_attributes.go
@@ -107,11 +107,13 @@ func setupRadiusDictionary() {
var InternalAttributes []*dictionary.Attribute
var ValueAttributes []*dictionary.Value
- ValueAttributes = append(ValueAttributes, &dictionary.Value{Attribute: ""})
for _, v := range RadiusConfiguration.RadiusAttributes {
- InternalAttributes = append(InternalAttributes, &dictionary.Attribute{Name: v, OID: dictionary.OID{29464}, Type: dictionary.AttributeString})
- ValueAttributes = append(ValueAttributes, &dictionary.Value{Attribute: v})
+ a := dictionary.AttributeByName(d.Attributes, v)
+ if a == nil {
+ InternalAttributes = append(InternalAttributes, &dictionary.Attribute{Name: v, OID: dictionary.OID{29464}, Type: dictionary.AttributeString})
+ }
}
+
appendRadiusAttributes(&results.Items, InternalAttributes, ValueAttributes, "")
res, _ := json.Marshal(&results) | Don't add attributes that are already there.
Fixes #<I> | inverse-inc_packetfence | train | go |
7ee167d46b0e46cc8cde9141eac1da4aed97387e | diff --git a/salt/modules/win_repo.py b/salt/modules/win_repo.py
index <HASH>..<HASH> 100644
--- a/salt/modules/win_repo.py
+++ b/salt/modules/win_repo.py
@@ -26,7 +26,7 @@ except ImportError:
import salt.output
import salt.utils
import logging
-from six import string_types
+from salt.utils.six import string_types
log = logging.getLogger(__name__) | Replaced module six in file /salt/modules/win_repo.py | saltstack_salt | train | py |
def1f5a3ba5263f84ba3ce3c6ebd0ad7e930974a | diff --git a/presto-cli/src/main/java/com/facebook/presto/cli/StatusPrinter.java b/presto-cli/src/main/java/com/facebook/presto/cli/StatusPrinter.java
index <HASH>..<HASH> 100644
--- a/presto-cli/src/main/java/com/facebook/presto/cli/StatusPrinter.java
+++ b/presto-cli/src/main/java/com/facebook/presto/cli/StatusPrinter.java
@@ -46,6 +46,7 @@ public class StatusPrinter
{
private static final Logger log = Logger.get(StatusPrinter.class);
+ private static final int CTRL_C = 3;
private static final int CTRL_P = 16;
private final long start = System.nanoTime();
@@ -99,6 +100,9 @@ Parallelism: 2.5
if (key == CTRL_P) {
partialCancel();
}
+ else if (key == CTRL_C) {
+ client.close();
+ }
else if (toUpperCase(key) == 'D') {
debug = !debug;
console.resetScreen(); | Handle ctrl-C as keyboard input in CLI
After the recent changes to read keyboard input during the status
update loop, the handler for SIGINT sporadically stops working.
When this occurs, ctrl-C is read as normal keyboard input. | prestodb_presto | train | java |
1ca26cbfa901928ba62a938131af86bc01c11917 | diff --git a/src/Eloquent/Builder.php b/src/Eloquent/Builder.php
index <HASH>..<HASH> 100644
--- a/src/Eloquent/Builder.php
+++ b/src/Eloquent/Builder.php
@@ -21,7 +21,11 @@ class Builder extends \Illuminate\Database\Eloquent\Builder
{
$key = $this->query->getCacheKey($columns);
- $results = $this->query->get($columns)->all();
+ $results = $this->query->get($columns);
+
+ if ($results instanceof Collection) {
+ $results = $results->all();
+ }
$connection = $this->model->getConnectionName(); | Add laravel <I> compat by checking query builder return type | ameliaikeda_rememberable | train | php |
b9370ef144cf060df1e2d65b820cf52efcb52b83 | diff --git a/inc/template-hierarchy.php b/inc/template-hierarchy.php
index <HASH>..<HASH> 100644
--- a/inc/template-hierarchy.php
+++ b/inc/template-hierarchy.php
@@ -54,7 +54,7 @@ class CareLib_Template_Hierarchy {
* @return void
*/
protected function wp_hooks() {
- add_filter( 'index_template', array( $this, 'index_template' ), 5 );
+ add_filter( 'template_include', array( $this, 'index_include' ), 95 );
add_filter( 'date_template', array( $this, 'date_template' ), 5 );
add_filter( 'author_template', array( $this, 'user_template' ), 5 );
add_filter( 'tag_template', array( $this, 'taxonomy_template' ), 5 );
@@ -77,8 +77,11 @@ class CareLib_Template_Hierarchy {
* @access public
* @return string $template
*/
- public function index_template() {
- return carelib_get( 'template-global' )->framework( apply_filters( "{$this->prefix}_index_template", null ) );
+ public function index_include( $template ) {
+ if ( get_index_template() === $template ) {
+ return carelib_get( 'template-global' )->framework( apply_filters( "{$this->prefix}_index_template", null ) );
+ }
+ return $template;
}
/** | Filter on template_include instead
This should catch all fallback instances | cipherdevgroup_carelib | train | php |
cf21be5dbdd4c3219f52663e326dd6a38e66426d | diff --git a/tests/kafka_rolling_restart/test_main.py b/tests/kafka_rolling_restart/test_main.py
index <HASH>..<HASH> 100644
--- a/tests/kafka_rolling_restart/test_main.py
+++ b/tests/kafka_rolling_restart/test_main.py
@@ -6,8 +6,6 @@ from requests.exceptions import RequestException
from yelp_kafka_tool.kafka_rolling_restart import main
-# Test read_cluster_value
-
@mock.patch.object(main.FuturesSession, 'get', autospec=True)
def test_read_cluster_value_partitions(mock_get):
response = mock.Mock(status_code=200, spec=requests.Response)
@@ -58,9 +56,6 @@ def test_read_cluster_value_server_down(mock_get):
assert b == 1 # 1 missing brokers
-# Test wait_for_stable_cluster
-
-
def read_cluster_state_values(first_part, repeat):
for value in first_part:
yield value | Remove comments, add script to itests | Yelp_kafka-utils | train | py |
32f0ce9f318060fa7aa87a5963a2a9f9979256bc | diff --git a/lib/twat/argparse.rb b/lib/twat/argparse.rb
index <HASH>..<HASH> 100644
--- a/lib/twat/argparse.rb
+++ b/lib/twat/argparse.rb
@@ -57,7 +57,11 @@ module Twat
end
def options
- @configthingfucken ||= getopts
+ begin
+ @configthingfucken ||= getopts
+ rescue OptionParser::InvalidOption
+ usage "Unknown option"
+ end
end
end | Fall over if we don't know that option | richo_twat | train | rb |
731042220799a0eed163dff9054381ed8344a5b2 | diff --git a/components/dashboards/org.wso2.carbon.dashboards.core/src/test/java/org/wso2/carbon/dashboards/core/internal/MockPermissionProvider.java b/components/dashboards/org.wso2.carbon.dashboards.core/src/test/java/org/wso2/carbon/dashboards/core/internal/MockPermissionProvider.java
index <HASH>..<HASH> 100644
--- a/components/dashboards/org.wso2.carbon.dashboards.core/src/test/java/org/wso2/carbon/dashboards/core/internal/MockPermissionProvider.java
+++ b/components/dashboards/org.wso2.carbon.dashboards.core/src/test/java/org/wso2/carbon/dashboards/core/internal/MockPermissionProvider.java
@@ -78,6 +78,12 @@ public class MockPermissionProvider implements PermissionProvider {
}
@Override
+ public List<Role> getGrantedRolesOfTenant(Permission permission, String s) throws PermissionException {
+ // TODO: Need to implement in-memory permission store.
+ return new ArrayList<>();
+ }
+
+ @Override
public List<Role> getGrantedRoles(String permissionID) throws PermissionException {
// TODO: 11/16/17 Need to implement in-memory permission store.
return new ArrayList<>(); | Update mock permission provider with newly added method | wso2_carbon-dashboards | train | java |
60ac03c08f942a8dda49b9f9f7d2ce7a63535414 | diff --git a/spec/api-app-spec.js b/spec/api-app-spec.js
index <HASH>..<HASH> 100644
--- a/spec/api-app-spec.js
+++ b/spec/api-app-spec.js
@@ -805,6 +805,14 @@ describe('app module', () => {
})
describe('getGPUInfo() API', () => {
+ before(function () {
+ // TODO(alexeykuzmoin): Fails on linux. Enable them back.
+ // https://github.com/electron/electron/pull/14863
+ if (process.platform === 'linux') {
+ this.skip()
+ }
+ })
+
it('succeeds with basic GPUInfo', (done) => {
app.getGPUInfo('basic').then((gpuInfo) => {
// Devices information is always present in the available info | test: disable getGPUInfo() tests on Linux (#<I>) | electron_electron | train | js |
25ee5e4cc7b01e6cc3029525ebd81a0091c7d005 | diff --git a/client/lib/domains/index.js b/client/lib/domains/index.js
index <HASH>..<HASH> 100644
--- a/client/lib/domains/index.js
+++ b/client/lib/domains/index.js
@@ -28,10 +28,7 @@ function canAddGoogleApps( domainName ) {
return includes( domainName, phrase );
} );
- if ( includes( GOOGLE_APPS_INVALID_TLDS, tld ) || includesBannedPhrase ) {
- return false;
- }
- return true;
+ return ! ( includes( GOOGLE_APPS_INVALID_TLDS, tld ) || includesBannedPhrase );
}
function canRegister( domainName, onComplete ) {
@@ -124,7 +121,7 @@ function hasGoogleApps( domain ) {
function getGoogleAppsSupportedDomains( domains ) {
return domains.filter( function( domain ) {
- return ( domain.type === domainTypes.REGISTERED );
+ return ( domain.type === domainTypes.REGISTERED && canAddGoogleApps( domain.meta ) );
} );
} | Domains: Add a check for supported domain to ensure they're not banned | Automattic_wp-calypso | train | js |
12945e5f473d684278191f1dbccef92ba389d058 | diff --git a/lib/netsuite/records/customer_refund.rb b/lib/netsuite/records/customer_refund.rb
index <HASH>..<HASH> 100644
--- a/lib/netsuite/records/customer_refund.rb
+++ b/lib/netsuite/records/customer_refund.rb
@@ -24,6 +24,7 @@ module NetSuite
attr_reader :internal_id
attr_accessor :external_id
+ attr_accessor :search_joins
def initialize(attributes = {})
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id) | Adding search_joins to customerrefund | NetSweet_netsuite | train | rb |
965cf1bae6cc9bcac756d1a539d61396f1ab0479 | diff --git a/packages/browserslist-config-instui/index.js b/packages/browserslist-config-instui/index.js
index <HASH>..<HASH> 100644
--- a/packages/browserslist-config-instui/index.js
+++ b/packages/browserslist-config-instui/index.js
@@ -29,5 +29,6 @@ module.exports = [
'last 2 ios versions',
'last 2 opera versions',
'last 2 safari versions',
- 'last 2 ChromeAndroid versions'
+ 'last 2 ChromeAndroid versions',
+ 'ie >= 11'
] | fix(browserslist-config-instui): fix broken tests caused by IE<I> support removal
TEST PLAN:
Make sure all tests are passing | instructure_instructure-ui | train | js |
0f200a56de4b2125960ad66b880b6b194471b0e4 | diff --git a/src/foremast/pipeline/construct_pipeline_block.py b/src/foremast/pipeline/construct_pipeline_block.py
index <HASH>..<HASH> 100644
--- a/src/foremast/pipeline/construct_pipeline_block.py
+++ b/src/foremast/pipeline/construct_pipeline_block.py
@@ -86,7 +86,7 @@ def construct_pipeline_block(env='',
})
LOG.info('Switching health check type to: EC2')
- LOG.info('White listed dev asg apps: {0}'.format(dev_asg_whitelist))
+ LOG.info('White listed dev asg apps: {0}'.format(ASG_WHITELIST))
if env == 'dev' and generated.app not in ASG_WHITELIST:
data['asg'].update({
'max_inst': '1', | Updated log line to proper list name | foremast_foremast | train | py |
338be378b142ed9371bc649d9090f4a3c7845f76 | diff --git a/lib/redlock/client.rb b/lib/redlock/client.rb
index <HASH>..<HASH> 100644
--- a/lib/redlock/client.rb
+++ b/lib/redlock/client.rb
@@ -61,15 +61,12 @@ module Redlock
# Locks a resource, executing the received block only after successfully acquiring the lock,
# and returning its return value as a result.
- # Params:
- # +resource+:: the resource (or key) string to be locked.
- # +ttl+:: the time-to-live in ms for the lock.
- # +block+:: block to be executed after successful lock acquisition.
- def lock!(resource, ttl)
+ # See Redlock::Client#lock for parameters.
+ def lock!(*args, **keyword_args)
fail 'No block passed' unless block_given?
- lock(resource, ttl) do |lock_info|
- raise LockError, "Could not acquire lock #{resource}" unless lock_info
+ lock(*args, **keyword_args) do |lock_info|
+ raise LockError, 'failed to acquire lock' unless lock_info
return yield
end
end | Adapt lock!() to handle extend parameter. | leandromoreira_redlock-rb | train | rb |
8bdd580907ffc45d79bb9cb8e4d04c2ac2b4cb17 | diff --git a/src/main/java/dtest/base/TestSession.java b/src/main/java/dtest/base/TestSession.java
index <HASH>..<HASH> 100644
--- a/src/main/java/dtest/base/TestSession.java
+++ b/src/main/java/dtest/base/TestSession.java
@@ -4,7 +4,7 @@ public class TestSession {
public String id;
- public int currentDataRecordIndex;
+ public Integer currentDataRecordIndex;
public int currentStepIndex;
@@ -18,7 +18,7 @@ public class TestSession {
public TestSession(String testSessionId) {
this.id = testSessionId;
- this.currentDataRecordIndex = -1;
+ this.currentDataRecordIndex = null;
this.currentIteration = 1;
this.currentStepIndex = -1;
this.currentTestIndex = -1; | Add the TestSession.currentDataRecordIndex field to support data-driven testing | mcdcorp_opentest | train | java |
0ef09645b8562e8b788f1f00793eb5a89b258e40 | diff --git a/src/module-elasticsuite-core/Api/Index/Mapping/FieldInterface.php b/src/module-elasticsuite-core/Api/Index/Mapping/FieldInterface.php
index <HASH>..<HASH> 100644
--- a/src/module-elasticsuite-core/Api/Index/Mapping/FieldInterface.php
+++ b/src/module-elasticsuite-core/Api/Index/Mapping/FieldInterface.php
@@ -28,6 +28,9 @@ interface FieldInterface
*
*/
+ /**
+ * @deprecated
+ */
const FIELD_TYPE_STRING = 'string';
const FIELD_TYPE_DOUBLE = 'double';
const FIELD_TYPE_INTEGER = 'integer'; | Mark string type as deprecated. | Smile-SA_elasticsuite | train | php |
965e1d63dcb4dfe1091a744b7918b057aaf2b4f9 | diff --git a/lib/application.js b/lib/application.js
index <HASH>..<HASH> 100644
--- a/lib/application.js
+++ b/lib/application.js
@@ -91,7 +91,14 @@ app.defaultConfiguration = function(){
};
this.locals.use = function(fn){
- self.viewCallbacks.push(fn);
+ if (3 == fn.length) {
+ self.viewCallbacks.push(fn);
+ } else {
+ self.viewCallbacks.push(function(req, res, done){
+ fn(req, res);
+ done();
+ });
+ }
return this;
}; | added sync signature for app.locals.use() | expressjs_express | train | js |
22181e8bfaadb5411c4a0c143419f31f7c579ddc | diff --git a/MangoPay/ApiUsers.php b/MangoPay/ApiUsers.php
index <HASH>..<HASH> 100644
--- a/MangoPay/ApiUsers.php
+++ b/MangoPay/ApiUsers.php
@@ -288,23 +288,20 @@ class ApiUsers extends Libraries\ApiBase
* @param string $userId User Id
* @param string $kycDocumentId KYC Document Id
* @param \MangoPay\KycPage $kycPage KYC Page
- * @return bool `true` if the upload was successful, `false` otherwise
+ * @return true always true. If an error occured, a \MangoPay\Libraries\Exception is thrown
* @throws \MangoPay\Libraries\Exception
*/
public function CreateKycPage($userId, $kycDocumentId, $kycPage, $idempotencyKey = null)
{
- $uploaded = false;
try {
- $response = $this->CreateObject('kyc_page_create', $kycPage, null, $userId, $kycDocumentId, $idempotencyKey);
- $uploaded = true;
+ $this->CreateObject('kyc_page_create', $kycPage, null, $userId, $kycDocumentId, $idempotencyKey);
} catch (\MangoPay\Libraries\ResponseException $exc) {
if ($exc->getCode() != 204) {
throw $exc;
- } else {
- $uploaded = true;
}
}
- return $uploaded;
+
+ return true;
}
/** | Adjusted ApiUsers::CreateKycPage return type documentation being misleading by stating it can return false.
Simplified the code accordingly. | Mangopay_mangopay2-php-sdk | train | php |
d482d99504df34cb847b697579207b3f856230db | diff --git a/bob/bio/spear/database/database.py b/bob/bio/spear/database/database.py
index <HASH>..<HASH> 100644
--- a/bob/bio/spear/database/database.py
+++ b/bob/bio/spear/database/database.py
@@ -9,15 +9,17 @@ import numpy
class AudioBioFile(BioFile):
- def __init__(self, client_id, path, file_id):
+ def __init__(self, client_id, path, file_id, **kwargs):
"""
Initializes this File object with an File equivalent for
VoxForge database.
"""
- super(AudioBioFile, self).__init__(client_id=client_id, path=path, file_id=file_id)
+ super(AudioBioFile, self).__init__(
+ client_id=client_id, path=path, file_id=file_id, **kwargs)
def load(self, directory=None, extension='.wav'):
- rate, audio = scipy.io.wavfile.read(self.make_path(directory, extension))
+ rate, audio = scipy.io.wavfile.read(
+ self.make_path(directory, extension))
# We consider there is only 1 channel in the audio file => data[0]
data = numpy.cast['float'](audio)
return rate, data | pass kwargs in the base file class | bioidiap_bob.bio.spear | train | py |
d099f11ee36ce652a24c8a260dfed735c843982c | diff --git a/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb b/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb
index <HASH>..<HASH> 100644
--- a/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb
+++ b/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb
@@ -9,6 +9,8 @@ module Polyamorous
if name.is_a? Join
reflection = find_reflection base_klass, name.name
reflection.check_validity!
+ reflection.check_eager_loadable! if ActiveRecord::VERSION::MAJOR >= 5
+
klass = if reflection.polymorphic?
name.klass || base_klass
else
@@ -18,6 +20,8 @@ module Polyamorous
else
reflection = find_reflection base_klass, name
reflection.check_validity!
+ reflection.check_eager_loadable! if ActiveRecord::VERSION::MAJOR >= 5
+
if reflection.polymorphic?
raise ActiveRecord::EagerLoadPolymorphicError.new(reflection)
end
@@ -115,7 +119,7 @@ module Polyamorous
hash[k] ||= {}
end
walk_tree(v, cache)
- end
+ end
else
super(associations, hash)
end | Add #eager_loadable
This is a "catch-up" commit with latest ActiveRecord methods.
Ref: <URL> | activerecord-hackery_polyamorous | train | rb |
6f554c73b5e50e719286a06c66a2732559c42d1e | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ try:
except ImportError:
from distutils.core import setup
-version = '0.2.2'
+version = '0.2.3'
if sys.argv[-1] == 'publish':
try:
@@ -50,7 +50,7 @@ setup(
],
license="MIT",
zip_safe=False,
- keywords=['django','cow','cms'],
+ keywords=['django', 'cow', 'cms'],
classifiers=[
'Development Status :: 3 - Alpha',
'Framework :: Django', | -Increment version - why not release | narfman0_cow | train | py |
f6d4d67bbde5b0475537c87dfe803c6c1de87130 | diff --git a/core/server/api/canary/memberSigninUrls.js b/core/server/api/canary/memberSigninUrls.js
index <HASH>..<HASH> 100644
--- a/core/server/api/canary/memberSigninUrls.js
+++ b/core/server/api/canary/memberSigninUrls.js
@@ -1,7 +1,11 @@
-const i18n = require('../../../shared/i18n');
+const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const membersService = require('../../services/members');
+const messages = {
+ memberNotFound: 'Member not found.'
+};
+
module.exports = {
docName: 'member_signin_urls',
permissions: true,
@@ -15,7 +19,7 @@ module.exports = {
if (!model) {
throw new errors.NotFoundError({
- message: i18n.t('errors.api.members.memberNotFound')
+ message: tpl(messages.memberNotFound)
});
} | Replaced i<I>n.t w/ tpl helper in memberSigninUrls.js (#<I>)
refs: #<I>
- The i<I>n package is deprecated. It is being replaced with the tpl package. | TryGhost_Ghost | train | js |
95badc13716081b5cc8ced7c1c7761018940de41 | diff --git a/cobra/flux_analysis/variability.py b/cobra/flux_analysis/variability.py
index <HASH>..<HASH> 100644
--- a/cobra/flux_analysis/variability.py
+++ b/cobra/flux_analysis/variability.py
@@ -35,6 +35,9 @@ def flux_variability_analysis(cobra_model, reaction_list=None,
lp = solver.create_problem(cobra_model)
solver.solve_problem(lp, objective_sense=objective_sense)
solution = solver.format_solution(lp, cobra_model)
+ if solution.status != "optimal":
+ raise ValueError("FVA requires the solution status to be optimal, not "
+ + solution.status)
# set all objective coefficients to 0
for i, r in enumerate(cobra_model.reactions):
if r.objective_coefficient != 0: | Raise ValueError for infeasible models in FVA
Fixes #<I> | opencobra_cobrapy | train | py |
93ccefb75b9e666db52079b19fa0a58615f4466b | diff --git a/lib/Drivers/DML/redshift.js b/lib/Drivers/DML/redshift.js
index <HASH>..<HASH> 100644
--- a/lib/Drivers/DML/redshift.js
+++ b/lib/Drivers/DML/redshift.js
@@ -23,10 +23,24 @@ Driver.prototype.insert = function (table, data, id_prop, cb) {
return cb(err);
}
- this.execQuery("SELECT LASTVAL() AS id", function (err, results) {
- return cb(null, {
- id: !err && results[0].id || null
+ if (id_prop === null) {
+ return cb(null);
+ }
+
+ if (id_prop.length == 1) {
+ return this.execQuery("SELECT LASTVAL() AS id", function (err, results) {
+ return cb(null, {
+ id: !err && results[0].id || null
+ });
});
- });
+ }
+
+ var ids = {};
+
+ for (var i = 0; i < id_prop.length; i++) {
+ ids[id_prop[i]] = data[id_prop[i]] || null;
+ }
+
+ return cb(null, ids);
}.bind(this));
}; | Updates redshift driver to try to support multiple keys | dresende_node-orm2 | train | js |
5c688eed025626824211b107a2f011ec91ec09ff | diff --git a/src/org/opencms/configuration/CmsVfsConfiguration.java b/src/org/opencms/configuration/CmsVfsConfiguration.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/configuration/CmsVfsConfiguration.java
+++ b/src/org/opencms/configuration/CmsVfsConfiguration.java
@@ -1,7 +1,7 @@
/*
* File : $Source: /alkacon/cvs/opencms/src/org/opencms/configuration/CmsVfsConfiguration.java,v $
- * Date : $Date: 2005/05/19 16:35:47 $
- * Version: $Revision: 1.32 $
+ * Date : $Date: 2005/05/31 07:49:55 $
+ * Version: $Revision: 1.33 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
@@ -661,8 +661,7 @@ public class CmsVfsConfiguration extends A_CmsXmlConfiguration implements I_CmsX
public void setXmlContentTypeManager(CmsXmlContentTypeManager manager) {
if (CmsLog.LOG.isInfoEnabled()) {
- CmsLog.LOG.info(Messages.get().key(
- Messages.get().key(Messages.INIT_VFS_XML_CONTENT_FINISHED_0)));
+ CmsLog.LOG.info(Messages.get().key(Messages.INIT_VFS_XML_CONTENT_FINISHED_0));
}
m_xmlContentTypeManager = manager;
} | The weirdest logging statement that would compile ever | alkacon_opencms-core | train | java |
80a74ba298155bce126fdeda72f8bf243750de56 | diff --git a/src/Parser.php b/src/Parser.php
index <HASH>..<HASH> 100644
--- a/src/Parser.php
+++ b/src/Parser.php
@@ -178,14 +178,12 @@ class Kint_Parser
$object->hash = $hash;
if (isset($this->object_hashes[$hash])) {
- $object->size = $this->object_hashes[$hash]->size;
$object->hints[] = 'recursion';
return $object;
}
if ($this->max_depth && $o->depth >= $this->max_depth) {
- $object->size = null;
$object->hints[] = 'depth_limit';
return $object; | Kint_Parser: Don't attempt to fill in the size of a recursive object
If it's recursing, the parent object will likely have an unfinished
size value.
If we guess the size prematurely by casting the object to an
array, this will cause sheer confusion when the user is being
told they're recursing into an object which clearly has a
different set of contents (As implied by the different counts) | kint-php_kint | train | php |
ec065c156a2d2880cec2452dac053c926f2f18bb | diff --git a/build/transpile.js b/build/transpile.js
index <HASH>..<HASH> 100644
--- a/build/transpile.js
+++ b/build/transpile.js
@@ -203,6 +203,7 @@ const pythonRegexes = [
[ /else\s*[\n]/g, "else:\n" ],
[ /for\s+\(([a-zA-Z0-9_]+)\s*=\s*([^\;\s]+\s*)\;[^\<\>\=]+(?:\<=|\>=|<|>)\s*(.*)\.length\s*\;[^\)]+\)\s*{/g, 'for $1 in range($2, len($3)):'],
[ /for\s+\(([a-zA-Z0-9_]+)\s*=\s*([^\;\s]+\s*)\;[^\<\>\=]+(?:\<=|\>=|<|>)\s*(.*)\s*\;[^\)]+\)\s*{/g, 'for $1 in range($2, $3):'],
+ [ /while\s+\(([a-zA-Z0-9_]+)\)\s*{*/g, 'while $1:'],
[ /\s\|\|\s/g, ' or ' ],
[ /\s\&\&\s/g, ' and ' ],
[ /\!([^\=])/g, 'not $1'], | add while (xxx) language syntax support | ccxt_ccxt | train | js |
b9c330f6eccb536646d19c3d6d97b80266a949c7 | diff --git a/lib/stylesheet_collector.js b/lib/stylesheet_collector.js
index <HASH>..<HASH> 100644
--- a/lib/stylesheet_collector.js
+++ b/lib/stylesheet_collector.js
@@ -113,7 +113,7 @@ exports.create = function( log, options ) {
.map( f => fileExists( f ).then( exists => exists ? [ f ] : [] ) ) )
.then( flatten )
.then( candidates => choose( theme, candidates ) );
- } ) );
+ } ) ).then( files => files.filter( f => !!f ) );
}
function choose( theme, candidates ) { | Don't fail when there's no CSS file for a theme | LaxarJS_laxar-tooling | train | js |
96b7b72b3f4cae9ec0dd99c7de4f0159e5c5e314 | diff --git a/lib/util.js b/lib/util.js
index <HASH>..<HASH> 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -28,9 +28,9 @@ function resolve(searchPath, pathBase) {
if (searchPath[0] == '.') {
modulePath = path.resolve(pathBase, searchPath)
} else {
- require.paths.unshift(pathBase)
- try { modulePath = require.resolve(searchPath) }
- catch(err) {}
+ // TODO Implement node's require.resolve here, with respect to pathBase
+ require.paths.unshift(path.dirname(pathBase) + '/..')
+ modulePath = require.resolve(searchPath)
require.paths.splice(0, 1)
}
return modulePath
diff --git a/server.js b/server.js
index <HASH>..<HASH> 100644
--- a/server.js
+++ b/server.js
@@ -77,7 +77,8 @@ function _handleMainModuleRequest(reqPath, res) {
return _sendError(res, reqPath, new Error('Could not find main module "' + reqPath + '"'))
}
- var deps = util.getDependencyList(modulePath)
+ try { var deps = util.getDependencyList(modulePath) }
+ catch(err) { return _sendError(res, reqPath, err) }
res.write('var require = {}\n')
each(deps, function(dependency) { | Throw error when resolution fails, such that the server can catch them and send an error to the client | marcuswestin_require | train | js,js |
7ca8f2b4153db22a681ee5ffebcc5992bf3f07bd | diff --git a/cv/internal/tree/tree.go b/cv/internal/tree/tree.go
index <HASH>..<HASH> 100644
--- a/cv/internal/tree/tree.go
+++ b/cv/internal/tree/tree.go
@@ -79,7 +79,7 @@ var clientCtxKey = "go.chromium.org/luci/cv/internal/tree.Client"
// InstallProd puts a production `Client` implementation.
func InstallProd(ctx context.Context) (context.Context, error) {
- t, err := auth.GetRPCTransport(ctx, auth.NoAuth, nil)
+ t, err := auth.GetRPCTransport(ctx, auth.NoAuth)
if err != nil {
return nil, err
} | cv: Stop passing nil RPCOption when creating transport for tree client
I misread the function signature. I thought it is taking a slice instead
of varArgs.
R=qyearsley, tandrii
Bug: <I>
Change-Id: I4bda8f<I>d<I>e6caa<I>cfbea9cf<I>d<I>e
Reviewed-on: <URL> | luci_luci-go | train | go |
324ec9fccdbc5cdbb69791b2965b697116f2bf50 | diff --git a/Twig/TwigExtension.php b/Twig/TwigExtension.php
index <HASH>..<HASH> 100644
--- a/Twig/TwigExtension.php
+++ b/Twig/TwigExtension.php
@@ -2,7 +2,7 @@
namespace BCC\CronManagerBundle\Twig;
-class TwigExtension extends \Twig_Extension implements Twig_Extension_GlobalsInterface
+class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
{
/**
* @var array | Fix class not found exception for Twig Extension. | michelsalib_BCCCronManagerBundle | train | php |
b511019450b7872c83ef294d6a1ddae212a97c4a | diff --git a/src/Illuminate/Foundation/Console/StubPublishCommand.php b/src/Illuminate/Foundation/Console/StubPublishCommand.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Console/StubPublishCommand.php
+++ b/src/Illuminate/Foundation/Console/StubPublishCommand.php
@@ -35,7 +35,6 @@ class StubPublishCommand extends Command
$files = [
__DIR__.'/stubs/job.queued.stub' => $stubsPath.'/job.queued.stub',
__DIR__.'/stubs/job.stub' => $stubsPath.'/job.stub',
- __DIR__.'/stubs/job.stub' => $stubsPath.'/job.stub',
__DIR__.'/stubs/model.pivot.stub' => $stubsPath.'/model.pivot.stub',
__DIR__.'/stubs/model.stub' => $stubsPath.'/model.stub',
__DIR__.'/stubs/test.stub' => $stubsPath.'/test.stub', | [7.x] Remove duplicated file. | laravel_framework | train | php |
6049035b9d61585e79aad23f24aa92b80c3f75ca | diff --git a/tests/ComponentHooks7Test.php b/tests/ComponentHooks7Test.php
index <HASH>..<HASH> 100644
--- a/tests/ComponentHooks7Test.php
+++ b/tests/ComponentHooks7Test.php
@@ -50,9 +50,10 @@ class ComponentHooks7Test extends DrupalCodeBuilderTestBase {
$files = $this->generateModuleFiles($module_data);
- $this->assertTrue(isset($files["$module_name.module"]), "The files list has a .module file.");
- $this->assertTrue(isset($files["$module_name.install"]), "The files list has a .install file.");
- $this->assertTrue(isset($files["$module_name.info"]), "The files list has a .info file.");
+ $file_names = array_keys($files);
+ $this->assertContains("$module_name.module", $file_names, "The files list has a .module file.");
+ $this->assertContains("$module_name.install", $file_names, "The files list has a .install file.");
+ $this->assertContains("$module_name.info", $file_names, "The files list has a .info file.");
// Check the .module file.
$module_file = $files["$module_name.module"]; | Changed test to use assertContains(). | drupal-code-builder_drupal-code-builder | train | php |
1d4aee8c46e928b9854b8956afd519f02fdaa73c | diff --git a/code/libraries/joomlatools/component/koowa/dispatcher/request/request.php b/code/libraries/joomlatools/component/koowa/dispatcher/request/request.php
index <HASH>..<HASH> 100644
--- a/code/libraries/joomlatools/component/koowa/dispatcher/request/request.php
+++ b/code/libraries/joomlatools/component/koowa/dispatcher/request/request.php
@@ -64,7 +64,7 @@ final class ComKoowaDispatcherRequest extends KDispatcherRequest
{
$port = parent::getPort();
- if ($this->isSecure() && $port == '80') {
+ if ($this->isSecure() && in_array($port, ['80', '8080'])) {
$port = '443';
} | #<I>: Make another special case for port <I> | joomlatools_joomlatools-framework | train | php |
6b40c5b312040568b4ef699eee5912389b1d51ca | diff --git a/src/Command/SiteStatusCommand.php b/src/Command/SiteStatusCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/SiteStatusCommand.php
+++ b/src/Command/SiteStatusCommand.php
@@ -91,9 +91,13 @@ class SiteStatusCommand extends ContainerAwareCommand
$systemData = [];
foreach ($requirements as $key => $requirement) {
- $title = $requirement['title']->render();
- $value = $requirement['value'];
- $systemData['system'][$title] = $value;
+ if ($requirement['title'] instanceof \Drupal\Core\StringTranslation\TranslatableMarkup) {
+ $title = $requirement['title']->render();
+ } else {
+ $title = $requirement['title'];
+ }
+
+ $systemData['system'][$title] = $requirement['value'];
}
$kernelHelper = $this->getKernelHelper(); | [site:status] Check for translatable strings before calling render() | hechoendrupal_drupal-console | train | php |
1106517fc8f6302555b44a33302614c29db521b7 | diff --git a/Services/FilterToQueryTranslator.php b/Services/FilterToQueryTranslator.php
index <HASH>..<HASH> 100644
--- a/Services/FilterToQueryTranslator.php
+++ b/Services/FilterToQueryTranslator.php
@@ -181,7 +181,7 @@ class FilterToQueryTranslator
$whereInConditions[] = $this->getFieldNameByCompassFilterType($field, $filter).' IN ('.implode(', ', $fieldVariants).')';
}
- return new DbQueryPart(implode(' AND ', $whereInConditions), $bindPlaceholders);
+ return new DbQueryPart(implode($filter->combiningConditions(), $whereInConditions), $bindPlaceholders);
}
/** | [create] change 'and' literal on call of combiningConditions | Antonyan_ddd-mappers-infrastructure | train | php |
5809623077b5d68a03f182d74b0feca414e114af | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -261,6 +261,23 @@ module.exports = function(_module, _dataFolder) {
+ /**
+ * Read a file.
+ *
+ * @param {String} filePath Path to file.
+ *
+ * @return {Promise}
+ */
+ testUtils.readFile = function(filePath) {
+ return fs.readFileAsync(filePath, { encoding: 'utf8' })
+ .then(function(contents) {
+ return contents.toString();
+ });
+ };
+
+
+
+
var utils = _.extend({}, testUtils, { | Added method to read a file. | waigo_test-utils | train | js |
dfae6b5c6b0aa376af5210242acc874610a8291c | diff --git a/src/styles/text/repeat_group.js b/src/styles/text/repeat_group.js
index <HASH>..<HASH> 100644
--- a/src/styles/text/repeat_group.js
+++ b/src/styles/text/repeat_group.js
@@ -62,14 +62,14 @@ export default class RepeatGroup {
// Check an object to see if it's a repeat within its designated group
static check (obj, layout, tile) {
- if (layout.repeat_distance != null && this.groups[tile][layout.repeat_group]) {
+ if (layout.repeat_distance && this.groups[tile][layout.repeat_group]) {
return this.groups[tile][layout.repeat_group].check(obj);
}
}
// Add an object to its designated group
static add (obj, layout, tile) {
- if (layout.repeat_distance != null) {
+ if (layout.repeat_distance) {
if (this.groups[tile][layout.repeat_group] == null) {
this.groups[tile][layout.repeat_group] = new RepeatGroup(
layout.repeat_group, | skip repeat check when repeat distance is zero | tangrams_tangram | train | js |
97704bb4e7d5b993c59e9f77082c25a3fbc29d1a | diff --git a/src/Aequasi/Bundle/CacheBundle/Command/CacheFlushCommand.php b/src/Aequasi/Bundle/CacheBundle/Command/CacheFlushCommand.php
index <HASH>..<HASH> 100755
--- a/src/Aequasi/Bundle/CacheBundle/Command/CacheFlushCommand.php
+++ b/src/Aequasi/Bundle/CacheBundle/Command/CacheFlushCommand.php
@@ -42,7 +42,5 @@ class CacheFlushCommand extends ContainerAwareCommand
$service = $this->getContainer()
->get( $serviceName );
$service->flushAll();
-
- return 1;
}
-}
\ No newline at end of file
+} | Removed error code from cache:flush command
"return 1" at the end of the command means "error code 1". If everything went fine, null or 0 should be return.
This is an issue when cache:flush is added to composer postInstall commands, because an error code stops the install procedure. | php-cache_cache-bundle | train | php |
3ad593f5835ce0f6ef98f65d841899e1355fa736 | diff --git a/src/geshi/cuesheet.php b/src/geshi/cuesheet.php
index <HASH>..<HASH> 100644
--- a/src/geshi/cuesheet.php
+++ b/src/geshi/cuesheet.php
@@ -118,8 +118,8 @@ $language_data = array (
'OBJECT_SPLITTERS' => array(
),
'REGEXPS' => array(
+ 2 => '\b[A-Za-z0-9]{5}\d{7}\b',
1 => '(?<=[\s:]|^)\d+(?=[\s:]|$)',
- 2 => '\b[A-Za-z]{5}\d{7}\b',
),
'STRICT_MODE_APPLIES' => GESHI_NEVER,
'SCRIPT_DELIMITERS' => array( | fix: ISRC allows for digits in first 5 places too | GeSHi_geshi-1.0 | train | php |
4cd71f237cdeaf7205e16e2d13f14ae78e557a08 | diff --git a/filetime_from_git/git_wrapper.py b/filetime_from_git/git_wrapper.py
index <HASH>..<HASH> 100644
--- a/filetime_from_git/git_wrapper.py
+++ b/filetime_from_git/git_wrapper.py
@@ -31,6 +31,11 @@ class _GitWrapperCommon(object):
'''
def __init__(self, repo_path):
self.git = Git()
+ self.git.update_environment(
+ GIT_CONFIG_NOSYSTEM='true',
+ HOME=os.getcwd(),
+ XDG_CONFIG_HOME=os.getcwd()
+ )
self.repo = Repo(os.path.abspath('.'))
def is_file_managed_by_git(self, path): | Sanitise the git environment when using `git_wrapper`
Otherwise peoples `~/.gitconfig` could cause commands in the wrapper to
fail. | getpelican_pelican-plugins | train | py |
2e168d11f6cbd6ce4b5b8c6942f503fbe907c509 | diff --git a/irc/client.py b/irc/client.py
index <HASH>..<HASH> 100644
--- a/irc/client.py
+++ b/irc/client.py
@@ -991,7 +991,8 @@ class DCCConnectionError(IRCError):
class DCCConnection(Connection):
- """This class represents a DCC connection.
+ """
+ A DCC (Direct Client Connection).
DCCConnection objects are instantiated by calling the dcc
method on an IRC object.
@@ -1107,6 +1108,8 @@ class DCCConnection(Connection):
if len(self.buffer) > 2 ** 14:
# Bad peer! Naughty peer!
+ log.info("Received >16k from a peer without a newline; "
+ "disconnecting.")
self.disconnect()
return
else: | Issue #<I>: Add logging around large DCC messages.
--HG--
extra : rebase_source : <I>bc<I>dbe<I>eec<I>c<I>ad<I> | jaraco_irc | train | py |
bd25104e33252b635d9cd51c501494f03e7e78bf | diff --git a/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpContentMessageInjectionFilter.java b/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpContentMessageInjectionFilter.java
index <HASH>..<HASH> 100644
--- a/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpContentMessageInjectionFilter.java
+++ b/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpContentMessageInjectionFilter.java
@@ -41,7 +41,7 @@ public class HttpContentMessageInjectionFilter extends HttpFilterAdapter<IoSessi
// GL.debug("http", getClass().getSimpleName() + " filterWriteHttpResponse.");
HttpContentMessage content = httpResponse.getContent();
String contentLength = httpResponse.getHeader(HEADER_CONTENT_LENGTH);
- if (content == null || contentLength == null) {
+ if (content == null || (contentLength == null && content.isComplete() )) {
HttpStatus httpStatus = httpResponse.getStatus();
if (contentAutomaticallyInjectable(httpStatus)) {
if (!httpResponse.isContentExcluded()) { | Updated the logic in HttpContentMessageInjectionFilter for non chuncked encoded messages | kaazing_gateway | train | java |
4e49a84fbbdd37bdacb812a8de6cf72b82c05382 | diff --git a/libkbfs/kbfs_ops.go b/libkbfs/kbfs_ops.go
index <HASH>..<HASH> 100644
--- a/libkbfs/kbfs_ops.go
+++ b/libkbfs/kbfs_ops.go
@@ -179,6 +179,11 @@ func (fs *KBFSOpsStandard) RefreshCachedFavorites(ctx context.Context) {
// AddFavorite implements the KBFSOps interface for KBFSOpsStandard.
func (fs *KBFSOpsStandard) AddFavorite(ctx context.Context,
fav Favorite) error {
+ if fav.Type == tlf.SingleTeam {
+ // Ignore team favorites for now, until CORE-5378 is ready.
+ return nil
+ }
+
kbpki := fs.config.KBPKI()
_, err := kbpki.GetCurrentSession(ctx)
isLoggedIn := err == nil | kbfs_ops: don't favorite team TLFs for now
Until the CORE side is ready. | keybase_client | train | go |
81dcf598634bd65eada7f9360e2c7a23944d10ef | diff --git a/lib/chef/provider/windows_task.rb b/lib/chef/provider/windows_task.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/provider/windows_task.rb
+++ b/lib/chef/provider/windows_task.rb
@@ -137,7 +137,7 @@ class Chef
end
end
else
- Chef::Log.warn "#{new_resource} task doesn't exists - nothing to do"
+ Chef::Log.warn "#{new_resource} task doesn't exist - nothing to do"
end
end
@@ -149,7 +149,7 @@ class Chef
run_schtasks "DELETE", "F" => ""
end
else
- Chef::Log.warn "#{new_resource} task doesn't exists - nothing to do"
+ Chef::Log.warn "#{new_resource} task doesn't exist - nothing to do"
end
end
@@ -180,7 +180,7 @@ class Chef
end
else
Chef::Log.fatal "#{new_resource} task doesn't exist - nothing to do"
- raise Errno::ENOENT, "#{new_resource}: task does not exist, cannot enable"
+ raise Errno::ENOENT, "#{new_resource}: task doesn't exist, cannot enable"
end
end | plural to singular, consistent use of contractions | chef_chef | train | rb |
eda3cb02fc2a4b87dc8c40cb8ea4942d20bc268d | diff --git a/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java b/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
index <HASH>..<HASH> 100644
--- a/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
+++ b/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
@@ -24,6 +24,7 @@ import grails.util.Environment;
import grails.util.GrailsNameUtils;
import grails.util.PluginBuildSettings;
import groovy.lang.Closure;
+import groovy.lang.ExpandoMetaClass;
import groovy.lang.GroovyObject;
import groovy.lang.GroovySystem;
import groovy.util.AntBuilder;
@@ -127,7 +128,7 @@ public class GrailsScriptRunner {
*/
public static void main(String[] args) {
System.setProperty("net.sf.ehcache.skipUpdateCheck", "true");
-
+ ExpandoMetaClass.enableGlobally();
originalIn = System.in;
originalOut = System.out; | enable EMC as early as possible to prevent meta class inconsistencies. fix for GRAILS-<I> "plugin dynamic methods added to a custom grails artefact are unavailable during integration testing" | grails_grails-core | train | java |
c61bcba8ba30b2f76112e83eeb241802857c6ada | diff --git a/hellocharts-library/src/lecho/lib/hellocharts/util/CasteljauComputator.java b/hellocharts-library/src/lecho/lib/hellocharts/util/CasteljauComputator.java
index <HASH>..<HASH> 100644
--- a/hellocharts-library/src/lecho/lib/hellocharts/util/CasteljauComputator.java
+++ b/hellocharts-library/src/lecho/lib/hellocharts/util/CasteljauComputator.java
@@ -36,11 +36,11 @@ public class CasteljauComputator {
}
// Copy first raw of points into this.points[0] array.
- System.arraycopy(points[0], 0, startPoints, 0, pointsNumber);
+ System.arraycopy(startPoints, 0, points[0], 0, pointsNumber);
- for (int i = 1, pointsIndex = pointsNumber; i < curveDegree; ++i, pointsIndex -= 2) {
+ for (int i = 1, pointsIndex = pointsNumber - 2; i < curveDegree; ++i, pointsIndex -= 2) {
- for (int indexX = 0, indexY = 1; indexY < pointsIndex; indexX += 2, indexY += 2) {
+ for (int indexX = 0, indexY = 1; indexY <= pointsIndex; indexX += 2, indexY += 2) {
// X value.
points[i][indexX] = (1 - t) * points[i - 1][indexX] + t * points[i - 1][indexX + 2]; | Fixed out of bounds error in CastaljauComputator | lecho_hellocharts-android | train | java |
0e0d96cec96408e513e1e1d9033cd119b31efbaf | diff --git a/client/driver/docker.go b/client/driver/docker.go
index <HASH>..<HASH> 100644
--- a/client/driver/docker.go
+++ b/client/driver/docker.go
@@ -249,23 +249,13 @@ func (d *DockerDriver) createContainer(ctx *ExecContext, task *structs.Task, dri
}
}
- mode := driverConfig.NetworkMode
- if mode == "" {
+ hostConfig.NetworkMode := driverConfig.NetworkMode
+ if hostConfig.NetworkMode == "" {
// docker default
- d.logger.Printf("[WARN] driver.docker: no mode specified for networking, defaulting to bridge")
- mode = "bridge"
+ d.logger.Printf("[INFO] driver.docker: networking mode not specified; defaulting to bridge")
+ hostConfig.NetworkMode = "bridge"
}
- // Ignore the container mode for now
- switch mode {
- case "default", "bridge", "none", "host":
- d.logger.Printf("[DEBUG] driver.docker: using %s as network mode", mode)
- default:
- d.logger.Printf("[ERR] driver.docker: invalid setting for network mode: %s", mode)
- return c, fmt.Errorf("Invalid setting for network mode: %s", mode)
- }
- hostConfig.NetworkMode = mode
-
// Setup port mapping and exposed ports
if len(task.Resources.Networks) == 0 {
d.logger.Print("[WARN] driver.docker: No network resources are available for port mapping") | Remove restrictions from docker networking mode; we assume users know what they are doing | hashicorp_nomad | train | go |
eb2fc89776a5837f25e4d349584e6b5476866923 | diff --git a/lib/jekyll/plugin_manager.rb b/lib/jekyll/plugin_manager.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll/plugin_manager.rb
+++ b/lib/jekyll/plugin_manager.rb
@@ -90,8 +90,8 @@ module Jekyll
end
def deprecation_checks
- pagination_included = (!(site.config['gems'] || []).include?('jekyll-paginate') || !defined?(Jekyll::Paginate))
- if site.config['paginate'] && pagination_included
+ pagination_included = (site.config['gems'] || []).include?('jekyll-paginate') || defined?(Jekyll::Paginate)
+ if site.config['paginate'] && !pagination_included
Jekyll::Deprecator.deprecation_message "You appear to have pagination " +
"turned on, but you haven't included the `jekyll-paginate` gem. " +
"Ensure you have `gems: [jekyll-paginate]` in your configuration file." | Correct the semantics of checking for jekyll-paginate | jekyll_jekyll | train | rb |
e6b0cf4e41b599cde431ac347d3341bff889498d | diff --git a/include/setup.php b/include/setup.php
index <HASH>..<HASH> 100644
--- a/include/setup.php
+++ b/include/setup.php
@@ -8,7 +8,7 @@ if ( ! isset($CFG) ) die("Please configure this product using config.php");
// upgrade checking - don't change this unless you want to trigger
// database upgrade messages it should be the max of all versions in
// all database.php files.
-$CFG->dbversion = 201907070902;
+$CFG->dbversion = 202009300851;
// Just turn this off to avoid security holes due to XML parsing
if ( function_exists ( 'libxml_disable_entity_loader' ) ) libxml_disable_entity_loader(); | Update the db version to <I> | tsugiproject_tsugi-php | train | php |
a19f344568723670ca83323c22fa1c4a81db4043 | diff --git a/ui/range_element.js b/ui/range_element.js
index <HASH>..<HASH> 100644
--- a/ui/range_element.js
+++ b/ui/range_element.js
@@ -82,7 +82,7 @@ shaka.ui.RangeElement = class extends shaka.ui.Element {
this.isChanging_ = true;
this.setBarValueForTouch_(e);
this.onChangeStart();
- }, {passive: true});
+ });
this.eventManager.listen(this.bar, 'input', () => {
this.onChange(); | Fix touchstart event procesing on Android.
Don't mark the event as passive, so Android can
process it properly.
NOTE: I still see occasional glitches while
seeking a live stream on Android, but the
behavior is much better. There might be another.
smaller bug affecting this, though.
Closes #<I>
Change-Id: Icdad0b<I>c<I>a<I>fd<I>da<I>c<I>b9d<I>d5 | google_shaka-player | train | js |
c6c645fe97cb4ebd57697a496b3df129ad7a96d3 | diff --git a/tests/beautify-tests.js b/tests/beautify-tests.js
index <HASH>..<HASH> 100755
--- a/tests/beautify-tests.js
+++ b/tests/beautify-tests.js
@@ -1,4 +1,3 @@
-#!/usr/bin/env node
/*global js_beautify */
/*jshint node:true */ | Remove node hashbang, it borks by tests | beautify-web_js-beautify | train | js |
6829d53a08940730ad681c473ec131e52ebafa2b | diff --git a/cobraadaptor/adaptor.go b/cobraadaptor/adaptor.go
index <HASH>..<HASH> 100644
--- a/cobraadaptor/adaptor.go
+++ b/cobraadaptor/adaptor.go
@@ -41,6 +41,7 @@ func NewCobraAdaptor(clientFlags *cliflags.ClientFlags) CobraAdaptor {
container.NewRunCommand(dockerCli),
container.NewStartCommand(dockerCli),
container.NewStopCommand(dockerCli),
+ container.NewTopCommand(dockerCli),
container.NewUnpauseCommand(dockerCli),
image.NewRemoveCommand(dockerCli),
image.NewSearchCommand(dockerCli),
diff --git a/usage.go b/usage.go
index <HASH>..<HASH> 100644
--- a/usage.go
+++ b/usage.go
@@ -34,7 +34,6 @@ var DockerCommandUsage = []Command{
{"save", "Save one or more images to a tar archive"},
{"stats", "Display a live stream of container(s) resource usage statistics"},
{"tag", "Tag an image into a repository"},
- {"top", "Display the running processes of a container"},
{"update", "Update configuration of one or more containers"},
{"version", "Show the Docker version information"},
{"wait", "Block until a container stops, then print its exit code"}, | Use spf<I>/cobra for docker top
This fix is part of the effort to convert commands to spf<I>/cobra #<I>.
Thif fix coverted command `docker top` to use spf<I>/cobra | docker_cli | train | go,go |
b2da2d238c7c505ad5de0ce301dfae89aef42081 | diff --git a/boskos/janitor/janitor.py b/boskos/janitor/janitor.py
index <HASH>..<HASH> 100755
--- a/boskos/janitor/janitor.py
+++ b/boskos/janitor/janitor.py
@@ -49,6 +49,8 @@ DEMOLISH_ORDER = [
Resource('', 'compute', 'instance-groups', None, 'zone', 'Yes', False, True),
Resource('', 'compute', 'instance-groups', None, 'zone', 'No', False, True),
Resource('', 'compute', 'instance-templates', None, None, None, False, True),
+ Resource('', 'compute', 'sole-tenancy', 'node-groups', 'zone', None, False, True),
+ Resource('', 'compute', 'sole-tenancy', 'node-templates', 'region', None, False, True),
Resource('beta', 'compute', 'network-endpoint-groups', None, None, None, True, False),
Resource('', 'compute', 'networks', 'subnets', 'region', None, True, True),
Resource('', 'compute', 'networks', None, '', None, False, True), | Add sole tenant resources to janitor cleanup list | kubernetes_test-infra | train | py |
8de762719ab4b235f74345d9e432011031ac336b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ from distutils.sysconfig import get_python_lib
setuptools.setup(
name='odoo-autodiscover',
use_scm_version=True,
- description='An Odoo launcher that discovers addons automatically',
+ description='Adapt Odoo to discovers installed addons automatically',
long_description='\n'.join((
open('README.rst').read(),
open('CHANGES.rst').read(), | setup.py: fix short description | acsone_odoo-autodiscover | train | py |
97921f5d77f50496660bd3cc230df6a0bd6140e1 | diff --git a/tools/interop_matrix/run_interop_matrix_tests.py b/tools/interop_matrix/run_interop_matrix_tests.py
index <HASH>..<HASH> 100755
--- a/tools/interop_matrix/run_interop_matrix_tests.py
+++ b/tools/interop_matrix/run_interop_matrix_tests.py
@@ -86,6 +86,8 @@ argp.add_argument(
type=str,
nargs='?',
help='Upload test results to a specified BQ table.')
+# Requests will be routed through specified VIP by default.
+# See go/grpc-interop-tests (internal-only) for details.
argp.add_argument(
'--server_host',
default='74.125.206.210',
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py
index <HASH>..<HASH> 100755
--- a/tools/run_tests/run_interop_tests.py
+++ b/tools/run_tests/run_interop_tests.py
@@ -1152,7 +1152,8 @@ def aggregate_http2_results(stdout):
}
-# A dictionary of prod servers to test.
+# A dictionary of prod servers to test against.
+# See go/grpc-interop-tests (internal-only) for details.
prod_servers = {
'default': 'grpc-test.sandbox.googleapis.com',
'gateway_v4': 'grpc-test4.sandbox.googleapis.com', | add comments to interop scripts | grpc_grpc | train | py,py |
c6dc097bef81c7751e0de72276a22282954784ce | diff --git a/tasks/constants.py b/tasks/constants.py
index <HASH>..<HASH> 100644
--- a/tasks/constants.py
+++ b/tasks/constants.py
@@ -13,15 +13,17 @@ AGENT_BASED_INTEGRATIONS = [
'apache',
'btrfs',
'datadog-checks-base',
- 'disk',
'directory',
+ 'disk',
'envoy',
'istio',
'kube_proxy',
'kubelet',
'linkerd',
- 'nfsstat',
+ 'mcache',
'network',
+ 'nfsstat',
+ 'postgres',
'powerdns_recursor',
'prometheus',
'redisdb',
@@ -30,5 +32,4 @@ AGENT_BASED_INTEGRATIONS = [
'system_core',
'teamcity',
'vsphere',
- 'postgres',
] | add mcache to the list of checks in Gitlab (#<I>) | DataDog_integrations-core | train | py |
c4e5640cca9bd44ccac5e9e6d2a15014fbce3f6f | diff --git a/hazelcast-jet-core/src/main/java/com/hazelcast/jet/Job.java b/hazelcast-jet-core/src/main/java/com/hazelcast/jet/Job.java
index <HASH>..<HASH> 100644
--- a/hazelcast-jet-core/src/main/java/com/hazelcast/jet/Job.java
+++ b/hazelcast-jet-core/src/main/java/com/hazelcast/jet/Job.java
@@ -17,6 +17,7 @@
package com.hazelcast.jet;
import com.hazelcast.config.MetricsConfig;
+import com.hazelcast.jet.annotation.EvolvingApi;
import com.hazelcast.jet.config.JobConfig;
import com.hazelcast.jet.config.ProcessingGuarantee;
import com.hazelcast.jet.core.DAG;
@@ -97,6 +98,7 @@ public interface Job {
*
* @since 4.3
*/
+ @EvolvingApi
@Nonnull
String getSuspensionCause(); | Mark `Job.getSuspensionCause` as evolving API (#<I>) | hazelcast_hazelcast | train | java |
4f9f5ea3fd48a6f044fb840300ea6794908dbb92 | diff --git a/drools-spring/src/test/java/org/drools/container/spring/MockEvaluatorDefinition.java b/drools-spring/src/test/java/org/drools/container/spring/MockEvaluatorDefinition.java
index <HASH>..<HASH> 100644
--- a/drools-spring/src/test/java/org/drools/container/spring/MockEvaluatorDefinition.java
+++ b/drools-spring/src/test/java/org/drools/container/spring/MockEvaluatorDefinition.java
@@ -23,7 +23,7 @@ import java.io.ObjectOutput;
import org.drools.core.base.ValueType;
import org.drools.core.base.evaluators.EvaluatorDefinition;
import org.drools.core.base.evaluators.Operator;
-import org.drools.spi.Evaluator;
+import org.drools.core.spi.Evaluator;
public class MockEvaluatorDefinition
implements | moved spi to core.spi, as refactoring was half way | kiegroup_droolsjbpm-integration | train | java |
0eac0381d81385703fc6986f01e878e795504cfa | diff --git a/identifiers/__init__.py b/identifiers/__init__.py
index <HASH>..<HASH> 100644
--- a/identifiers/__init__.py
+++ b/identifiers/__init__.py
@@ -28,11 +28,15 @@ word, number, letter, symbol, or any combination of those."
"""
+# standard library imports
from __future__ import absolute_import
-from .identifier import Identifier
-from .gs1 import GLN, GSIN, GTIN12, GTIN13, GTIN14, SSCC
-from .bookland import ISBN, ISMN, ISSN
+
+# local imports
from .banking import BIC, IBAN
+from .bookland import ISBN, ISMN, ISSN
+from .finance import MIC, ISIN
+from .gs1 import GLN, GSIN, GTIN12, GTIN13, GTIN14, SSCC
+from .identifier import Identifier
__version__ = 0, 1, 0
@@ -51,4 +55,6 @@ __all__ = [
'ISSN',
'BIC',
'IBAN',
+ 'MIC',
+ 'ISIN'
] | Added MIC and ISIN to __all__ | mamrhein_identifiers | train | py |
1633a6035d8b56ad9dd33fc7b3502eb4928d9465 | diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -29,9 +29,9 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2019110800.01; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2019111200.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
-$release = '3.8dev+ (Build: 20191108)'; // Human-friendly version name
+$release = '3.8beta (Build: 20191112)'; // Human-friendly version name
$branch = '38'; // This version's branch.
-$maturity = MATURITY_ALPHA; // This version's maturity level.
+$maturity = MATURITY_BETA; // This version's maturity level. | Moodle release <I>beta | moodle_moodle | train | php |
2ad7e60a5098fc3c4ecf7121287d8573bc808ca1 | diff --git a/lib/connection.js b/lib/connection.js
index <HASH>..<HASH> 100644
--- a/lib/connection.js
+++ b/lib/connection.js
@@ -333,7 +333,9 @@ Connection.prototype.handleTransmissionError = function (data) {
*/
Connection.prototype.raiseError = function(errorCode, notification) {
debug("Raising error:", errorCode, notification);
- if (typeof this.options.errorCallback == 'function') {
+ if (notification && typeof notification.errorCallback == 'function' ) {
+ notification.errorCallback(errorCode);
+ } else if (typeof this.options.errorCallback == 'function') {
this.options.errorCallback(errorCode, notification);
}
}; | Added support for per notification error callbacks. | node-apn_node-apn | train | js |
1000c4046de7a96c43deae00af4fef578a2e9747 | diff --git a/ui/src/components/date/QDate.js b/ui/src/components/date/QDate.js
index <HASH>..<HASH> 100644
--- a/ui/src/components/date/QDate.js
+++ b/ui/src/components/date/QDate.js
@@ -727,9 +727,9 @@ export default defineComponent({
setCalendarTo(today.value.year, today.value.month)
}
- function setView (view) {
- if (viewIsValid(view) === true) {
- view.value = view
+ function setView (viewMode) {
+ if (viewIsValid(viewMode) === true) {
+ view.value = viewMode
}
} | Update QDate.js (#<I>) | quasarframework_quasar | train | js |
b65baea95e92be9182ea721b8a9bca77d54f9bf2 | diff --git a/cloudfoundry-client/src/main/lombok/org/cloudfoundry/client/v2/serviceinstances/UpdateServiceInstanceRequest.java b/cloudfoundry-client/src/main/lombok/org/cloudfoundry/client/v2/serviceinstances/UpdateServiceInstanceRequest.java
index <HASH>..<HASH> 100644
--- a/cloudfoundry-client/src/main/lombok/org/cloudfoundry/client/v2/serviceinstances/UpdateServiceInstanceRequest.java
+++ b/cloudfoundry-client/src/main/lombok/org/cloudfoundry/client/v2/serviceinstances/UpdateServiceInstanceRequest.java
@@ -41,7 +41,7 @@ public final class UpdateServiceInstanceRequest implements Validatable {
* @return the accept incomplete flag
*/
@Getter(onMethod = @__(@QueryParameter("accepts_incomplete")))
- private final boolean acceptsIncomplete;
+ private final Boolean acceptsIncomplete;
/**
* The name
@@ -85,10 +85,9 @@ public final class UpdateServiceInstanceRequest implements Validatable {
*/
@Getter(onMethod = @__({@JsonProperty("tags"), @JsonInclude(NON_EMPTY)}))
private final List<String> tags;
-
-
+
@Builder
- UpdateServiceInstanceRequest(boolean acceptsIncomplete,
+ UpdateServiceInstanceRequest(Boolean acceptsIncomplete,
String name,
@Singular Map<String, Object> parameters,
String serviceInstanceId, | Polishing
Noticed boolean type in UpdateServiceInstanceRequest.java. Appears to be
an oversight. | cloudfoundry_cf-java-client | train | java |
22c98976d6856a111c79c6d4e5fd05551b388a50 | diff --git a/client/extjs/lib/ext.ux/ItemRegistry.js b/client/extjs/lib/ext.ux/ItemRegistry.js
index <HASH>..<HASH> 100644
--- a/client/extjs/lib/ext.ux/ItemRegistry.js
+++ b/client/extjs/lib/ext.ux/ItemRegistry.js
@@ -50,11 +50,10 @@ Ext.ux.ItemRegistry.registerItem = function(key, itemkey, item, pos) {
Ext.ux.ItemRegistry.itemMap[key] = {};
}
- Ext.ux.ItemRegistry.itemMap[key][itemkey] = {
+ Ext.ux.ItemRegistry.itemMap[key][itemkey] = {
item: item,
pos: pos
- };
-
+ };
};
Ext.ux.ItemRegistry.prototype = {
@@ -177,4 +176,4 @@ itemRegTestPanel60 = {
html: 'add panel pos 60'
};
Ext.ux.ItemRegistry.registerItem('testWin', itemRegTestPanel60, 60);
-*/
\ No newline at end of file
+*/ | Fixes minor coding style issue | Arcavias_arcavias-core | train | js |
287c72d6bc910cbb0fe7e6649eb16e089a1710ef | diff --git a/awsmfa/__init__.py b/awsmfa/__init__.py
index <HASH>..<HASH> 100755
--- a/awsmfa/__init__.py
+++ b/awsmfa/__init__.py
@@ -79,7 +79,7 @@ def main():
help="Setup a new log term credentials section",
action="store_true",
required=False)
- parser.add_argument('--token', '--mfa-token'
+ parser.add_argument('--token', '--mfa-token',
type=str,
help="Provide MFA token as an argument",
required=False) | fixed missing comma typo / regression | broamski_aws-mfa | train | py |
7edac82ba3f03975612e4c524379b03a4900a8a1 | diff --git a/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php b/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php
index <HASH>..<HASH> 100644
--- a/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php
+++ b/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php
@@ -68,7 +68,9 @@ class LazyLoadingGhostFunctionalTest extends PHPUnit_Framework_TestCase
$proxyName = $this->generateProxy($className);
/* @var $proxy \ProxyManager\Proxy\GhostObjectInterface|BaseClass */
- $proxy = unserialize(serialize($proxyName::staticProxyConstructor($this->createInitializer($className, $instance))));
+ $proxy = unserialize(serialize($proxyName::staticProxyConstructor(
+ $this->createInitializer($className, $instance)
+ )));
$this->assertTrue($proxy->isProxyInitialized());
$this->assertSame($expectedValue, call_user_func_array(array($proxy, $method), $params)); | Fixed line length overflow (limit is <I> chars) | Ocramius_ProxyManager | train | php |
68699fa35ff245175455f40a735c234e09d06032 | diff --git a/src/Infrastructure/FilterSpec.php b/src/Infrastructure/FilterSpec.php
index <HASH>..<HASH> 100644
--- a/src/Infrastructure/FilterSpec.php
+++ b/src/Infrastructure/FilterSpec.php
@@ -185,6 +185,11 @@ class FilterSpec
*/
private function handleValue($value)
{
+ // Convert booleans to integers
+ if (is_bool($value)) {
+ $value = (int) $value;
+ }
+
$this->setValue($value);
$this->setType(self::TYPE_EQUALS);
}
@@ -224,12 +229,12 @@ class FilterSpec
/**
- * @param string $value
+ * @param mixed $value
*
* @return bool
*/
private function isValue($value)
{
- return is_string($value);
+ return is_string($value) || is_int($value) || is_bool($value);
}
} | Consider integers and booleans to be "values" too
- Cast booleans to integers in handleValue() | digiaonline_lumen-core | train | php |
0419b26028c0283e92a22a20fbf42c106b7bfa60 | diff --git a/utilities/api-generator.js b/utilities/api-generator.js
index <HASH>..<HASH> 100644
--- a/utilities/api-generator.js
+++ b/utilities/api-generator.js
@@ -26,9 +26,14 @@ module.exports = function (server, mongoose, Log, config) {
fs.readdir(apiPath, function(err, files) {
if (err) {
if (err.message.includes('no such file')) {
- Log.error(err);
- deferred.reject("The api directory provided is either empty or does not exist. " +
- "Try setting the 'apiPath' property of the config file.");
+ if (config.absoluteApiPath === true) {
+ Log.error(err);
+ deferred.reject("The api directory provided is either empty or does not exist. " +
+ "Try setting the 'apiPath' property of the config file.");
+ }
+ else {
+ deferred.resolve();
+ }
}
else {
deferred.reject(err); | Prevent error if default api directory doesn't exist. | JKHeadley_rest-hapi | train | js |
89f53bad2adb92eeee5972608a67c05e2328f5dd | diff --git a/src/sap.f/src/sap/f/DynamicPage.js b/src/sap.f/src/sap/f/DynamicPage.js
index <HASH>..<HASH> 100644
--- a/src/sap.f/src/sap/f/DynamicPage.js
+++ b/src/sap.f/src/sap/f/DynamicPage.js
@@ -442,6 +442,8 @@ sap.ui.define([
}
this.setAggregation("header", oHeader);
+
+ return this;
};
DynamicPage.prototype.setStickySubheaderProvider = function (sStickySubheaderProviderId) {
@@ -449,7 +451,7 @@ sap.ui.define([
sOldStickySubheaderProviderId = this.getStickySubheaderProvider();
if (sStickySubheaderProviderId === sOldStickySubheaderProviderId) {
- return;
+ return this;
}
oOldStickySubheaderProvider = sap.ui.getCore().byId(sOldStickySubheaderProviderId); | [INTERNAL] sap.f: minor fixes in overridden API methods
Fixes mutator methods that have been added recently and which are
documented to return 'this' but failed do so.
This change is a preparation for an enhanced version of the
generic test 'SettersContextReturn.qunit.js'.
Change-Id: I<I>fa<I>b<I>cf<I>fae<I>ad<I>fa<I>f9e5 | SAP_openui5 | train | js |
ac27e2edcdab91f172329eec3e2910b73c15a072 | diff --git a/tests/e2e/kubetest2-kops/deployer/up.go b/tests/e2e/kubetest2-kops/deployer/up.go
index <HASH>..<HASH> 100644
--- a/tests/e2e/kubetest2-kops/deployer/up.go
+++ b/tests/e2e/kubetest2-kops/deployer/up.go
@@ -118,6 +118,7 @@ func (d *deployer) createCluster(zones []string, adminAccess string) error {
if d.GCPProject != "" {
args = appendIfUnset(args, "--project", d.GCPProject)
}
+ args = appendIfUnset(args, "--vpc", strings.Split(d.ClusterName, ".")[0])
case "digitalocean":
args = appendIfUnset(args, "--master-size", "s-8vcpu-16gb")
} | kubetest2 - Specify GCE network name
Kops defaults to a network named "default" and has issues with network modes.
Apparently there is a "default" network within the projects that boskos issues,
causing `kops create cluster` to fail some cloudup validation.
By specifying a cluster-specific network, kops will create this new network with the non-deprecated settings. | kubernetes_kops | train | go |
04b922c5aba6b81811d18ad7cba4faf311b5a174 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name='MR-eBook-Downloader',
- version='1.2.2.dev1',
+ version='1.3.0.dev',
description='MR ebook downloader.',
author='Iceflower S',
author_email='iceflower@gmx.de', | [doc] Set new dev version | IceflowRE_unidown | train | py |
5860dd5f80b842fe026542118eb565c20189a7d2 | diff --git a/command/container/stats_helpers.go b/command/container/stats_helpers.go
index <HASH>..<HASH> 100644
--- a/command/container/stats_helpers.go
+++ b/command/container/stats_helpers.go
@@ -155,11 +155,13 @@ func collect(ctx context.Context, s *formatter.ContainerStats, cli client.APICli
waitFirst.Done()
}
case err := <-u:
+ s.SetError(err)
+ if err == io.EOF {
+ break
+ }
if err != nil {
- s.SetError(err)
continue
}
- s.SetError(nil)
// if this is the first stat you get, release WaitGroup
if !getFirst {
getFirst = true | exit collect when we get EOF | docker_cli | train | go |
706ecb4444ac552bd674adae3bd049b010e595e8 | diff --git a/luamin.js b/luamin.js
index <HASH>..<HASH> 100644
--- a/luamin.js
+++ b/luamin.js
@@ -328,7 +328,15 @@
} else if (expressionType == 'CallExpression') {
- result = formatExpression(expression.base) + '(';
+ if (
+ expression.base.inParens &&
+ expression.base.type == 'FunctionDeclaration'
+ ) {
+ result = '(' + formatExpression(expression.base) + ')(';
+ } else {
+ result = formatExpression(expression.base) + '(';
+ }
+
each(expression.arguments, function(argument, needsComma) {
result += formatExpression(argument);
if (needsComma) {
diff --git a/tests/tests.js b/tests/tests.js
index <HASH>..<HASH> 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -988,6 +988,11 @@
'description': 'FunctionDeclaration + WhileStatement',
'original': 'a = function() while true do end end',
'minified': 'a=function()while true do end end'
+ },
+ {
+ 'description': 'CallExpression + FunctionDeclaration lambda',
+ 'original': '(function() end)()',
+ 'minified': '(function()end)()'
}
], | Don’t remove parens around anonymous functions in call expressions
Fixes #<I>. Closes #<I>. | mathiasbynens_luamin | train | js,js |
cf72d81b9f41e7c872c261f044063f01bf9398ff | diff --git a/detect_secrets/core/scan.py b/detect_secrets/core/scan.py
index <HASH>..<HASH> 100644
--- a/detect_secrets/core/scan.py
+++ b/detect_secrets/core/scan.py
@@ -159,6 +159,10 @@ def _process_line_based_plugins(
# filters return True.
for line_number, line in lines:
line = line.rstrip()
+ code_snippet = get_code_snippet(
+ lines=line_content,
+ line_number=line_number,
+ )
# We apply line-specific filters, and see whether that allows us to quit early.
if any([
@@ -166,10 +170,7 @@ def _process_line_based_plugins(
filter_fn,
filename=filename,
line=line,
- context=get_code_snippet(
- lines=line_content,
- line_number=line_number,
- ),
+ context=code_snippet,
)
for filter_fn in get_filters_with_parameter('line')
]):
@@ -184,10 +185,7 @@ def _process_line_based_plugins(
secret=secret.secret_value,
plugin=plugin,
line=line,
- context=get_code_snippet(
- lines=line_content,
- line_number=line_number,
- ),
+ context=code_snippet,
):
log.debug(f'Skipping "{secret.secret_value}" due to `{filter_fn.path}`.')
break | store code snippet in variable instead of recreating | Yelp_detect-secrets | train | py |
3973a4830753557b08999341bef86a6a6671b96d | diff --git a/activerecord/test/cases/relation/where_test.rb b/activerecord/test/cases/relation/where_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/relation/where_test.rb
+++ b/activerecord/test/cases/relation/where_test.rb
@@ -304,8 +304,6 @@ module ActiveRecord
end
def test_where_with_unsupported_arguments
- author = authors(:david)
-
assert_raises(ArgumentError) { Author.where(42) }
end
end | Suppress warnings of `assigned but unused variable` | rails_rails | train | rb |
7fcb0869eb77fa37310877ed1467e5cfc2f144d7 | diff --git a/sendgrid/migrations/0001_initial.py b/sendgrid/migrations/0001_initial.py
index <HASH>..<HASH> 100644
--- a/sendgrid/migrations/0001_initial.py
+++ b/sendgrid/migrations/0001_initial.py
@@ -8,7 +8,7 @@ import sendgrid.models
class Migration(migrations.Migration):
dependencies = [
- ('django', '__first__'),
+ ('contenttypes', '__first__'),
]
operations = [
@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
('event', models.CharField(max_length=32, verbose_name='event type')),
('timestamp', models.DateTimeField(verbose_name='timestamp')),
('uuid', models.CharField(default=sendgrid.models._new_uuid, max_length=64, verbose_name='reference UUID', db_index=True)),
- ('content_type', models.ForeignKey(to='django.ContentType', null=True)),
+ ('content_type', models.ForeignKey(to='contenttypes.ContentType', null=True)),
],
options={
}, | fixing issue with dj <I>+ migrations | resmio_django-sendgrid | train | py |
5c50e11c569d99e0e66d0b74d9cb0a73524a8567 | diff --git a/master/buildbot/test/unit/test_interfaces.py b/master/buildbot/test/unit/test_interfaces.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/unit/test_interfaces.py
+++ b/master/buildbot/test/unit/test_interfaces.py
@@ -74,7 +74,7 @@ class TestIWorker(unittest.TestCase):
from buildbot.interfaces import IWorker
from buildbot.interfaces import IBuildSlave
- self.assertIs(IBuildSlave, IWorker)
+ self.assertTrue(IBuildSlave is IWorker)
class ILatentWorker(unittest.TestCase):
@@ -83,4 +83,4 @@ class ILatentWorker(unittest.TestCase):
from buildbot.interfaces import ILatentWorker
from buildbot.interfaces import ILatentBuildSlave
- self.assertIs(ILatentBuildSlave, ILatentWorker)
+ self.assertTrue(ILatentBuildSlave is ILatentWorker) | replace assertIs(a, b) with assertTrue(a is b) for Python <I> | buildbot_buildbot | train | py |
a9394d2547be6ecbaf56e987fee1d32fe24d5277 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -8,7 +8,7 @@ module.exports = function(grunt) {
clean: [
'./_allDbs',
'testdb_*',
- 'test_suite_db'
+ 'test_suite_*'
],
server: {
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -157,9 +157,10 @@ app.all('/:db/_all_docs', function (req, res, next) {
if (req.method !== 'GET' && req.method !== 'POST') return next();
// Check that the request body is an object.
- if (typeof req.body !== 'object' || Array.isArray(req.body)) {
- return res.send(400, Pouch.BAD_REQUEST);
- }
+ // Necessary to pass CouchDB suite, but fails on PouchDB suite when implemented
+ // if (typeof req.body !== 'object' || Array.isArray(req.body)) {
+ // return res.send(400, Pouch.BAD_REQUEST);
+ // }
for (var prop in req.body) {
req.query[prop] = req.query[prop] || req.body[prop]; | Trying to get pouchdb suite passing again | pouchdb_pouchdb-server | train | js,js |
b224c0daa633a0926a2b2e71dc4d8e5925b8ce4b | diff --git a/tests/acceptance/oepaypal/oxidAdditionalSeleniumFunctions.php b/tests/acceptance/oepaypal/oxidAdditionalSeleniumFunctions.php
index <HASH>..<HASH> 100644
--- a/tests/acceptance/oepaypal/oxidAdditionalSeleniumFunctions.php
+++ b/tests/acceptance/oepaypal/oxidAdditionalSeleniumFunctions.php
@@ -1154,7 +1154,12 @@ class oxidAdditionalSeleniumFunctions extends PHPUnit_Extensions_SeleniumTestCas
$sParsedText = $this->getText( $sPath );
return ( strpos( $sParsedText, $sText) !== false );
} else {
- return parent::isTextPresent( $sText );
+ try {
+ return parent::isTextPresent( $sText );
+ } catch (Exception $e) {
+ sleep(1);
+ return parent::isTextPresent( $sText );
+ }
}
} | Fixing isTextPresent selenium problem
(cherry picked from commit <I>d2) | OXID-eSales_paypal | train | php |
344d5fb4e692a83b2526b19a2924d6ecce3fa3d6 | diff --git a/cumulusci/newcli/cli.py b/cumulusci/newcli/cli.py
index <HASH>..<HASH> 100644
--- a/cumulusci/newcli/cli.py
+++ b/cumulusci/newcli/cli.py
@@ -42,6 +42,10 @@ class CliConfig(object):
self._load_global_config()
self._load_project_config()
self._load_keychain()
+ self._add_repo_to_path()
+
+ def _add_repo_to_path(self):
+ sys.path.append(self.project_config.repo_root)
def _load_global_config(self):
try: | inject repo path into sys path for python classes | SFDO-Tooling_CumulusCI | train | py |
dc32e0ee916eaf48fbda839f628c50021de2d769 | diff --git a/api/register.go b/api/register.go
index <HASH>..<HASH> 100644
--- a/api/register.go
+++ b/api/register.go
@@ -1,9 +1,11 @@
package api
import (
+ "bufio"
"fmt"
"github.com/gin-gonic/gin"
"github.com/gorilla/sessions"
+ "io/ioutil"
"net/http"
)
@@ -147,8 +149,12 @@ func (this *EngineGroup) DELETE(path string, handler APIHandler) {
func (this *EngineGroup) getHandlerImp(handler APIHandler) gin.HandlerFunc {
return func(c *gin.Context) {
var data interface{}
- err := c.ParseBody(&data)
+ body, _ := ioutil.ReadAll(c.Request.Body)
+ err := json.Marshal(body, &data)
if err != nil {
+ var buffer bytes.Buffer
+ buffer.Write(body)
+ c.Request.Body = bufio.NewWriter(&buffer)
//panic(err)
}
context := &Context{ | support ParseBody, ParseForm both | blackss2_utility | train | go |
1ad374cdf27a28712e4b8468bca35a3246e20e07 | diff --git a/lib/instrumental.js b/lib/instrumental.js
index <HASH>..<HASH> 100644
--- a/lib/instrumental.js
+++ b/lib/instrumental.js
@@ -138,18 +138,16 @@ function instrumental_send(payload) {
});
// What do we do when instrumental talks to us
- //
- // You know, we're early in the development cycle. We will (at most) expect
- // to receive "ok\nok\n" back from the server (ACK our header). Such a small
- // amount of data shouldn't be split into multiple packets... though I guess
- // we will find out.
+ var totalBuffer = "";
client.on("data", function(buffer) {
+ totalBuffer = totalBuffer + buffer;
+
if(debug) {
util.puts("Received:", buffer);
}
// Authorization success
- if(buffer == "ok\nok\n") {
+ if(totalBuffer == "ok\nok\n") {
error = false;
if(debug) {
@@ -163,7 +161,7 @@ function instrumental_send(payload) {
instrumentalStats.last_flush = Math.round(new Date().getTime() / 1000);
// Authorization failure
- } else if(buffer == "ok\nfail\n") {
+ } else if(totalBuffer.length >= "ok\nok\n".length) {
// TODO: Actually do something with this
error = true; | Handle multiple packets for protocol initialization.
Also assumes failure in the case that anything but the acceptable response is seen. | Instrumental_statsd-instrumental-backend | train | js |
3f48776b8b7f6911a320db634a6215123efd3f57 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -9,7 +9,7 @@ exports.install = function (vue, browserify) {
if (installed) return
installed = true
- Vue = vue
+ Vue = vue.__esModule ? vue.default : vue
version = Vue.version.split('.').map(Number)
isBrowserify = browserify | compat with Vue esm builds | vuejs_vue-hot-reload-api | train | js |
0fdf8b4692bbfdba0a2d1ecf15754f31c988afad | diff --git a/marrow/mongo/core/__init__.py b/marrow/mongo/core/__init__.py
index <HASH>..<HASH> 100644
--- a/marrow/mongo/core/__init__.py
+++ b/marrow/mongo/core/__init__.py
@@ -6,11 +6,5 @@ from .field import Field
from .index import Index
from .document import Document
-from .registry import Registry
-
__all__ = ['__version__', 'Field', 'Index', 'Document']
-
-_field_registry = Registry('marrow:mongo', 'marrow.mongo.field')
-_document_registry = Registry('marrow:mongo', 'marrow.mongo.document')
- | Removed use of legacy registries. | marrow_mongo | train | py |
6e98ed99f016e155efbad6057e4a479566d7282c | diff --git a/packages/chrysalis-focus/src/lib/chrysalis-focus.js b/packages/chrysalis-focus/src/lib/chrysalis-focus.js
index <HASH>..<HASH> 100644
--- a/packages/chrysalis-focus/src/lib/chrysalis-focus.js
+++ b/packages/chrysalis-focus/src/lib/chrysalis-focus.js
@@ -36,8 +36,7 @@ class Focus {
if (!instance) {
instance = this
this._commands = {
- help: this._help,
- version: this._version
+ help: this._help
}
}
@@ -252,28 +251,6 @@ class Focus {
let data = await s.request("help")
return data.split(/\r?\n/)
}
-
- async _version(s) {
- let data = await s.request("version")
-
- let [fv, ...r] = data.split(" ")
- let [vp, date] = r.join(" ").split(" | ")
-
- fv = fv.split("/")
- vp = vp.split("/")
-
- return {
- board: {
- vendor: vp[0],
- product: vp[1]
- },
- firmware: {
- name: fv[0],
- version: fv[1],
- date: date
- }
- }
- }
}
export default Focus | Don't try to parse the version | keyboardio_chrysalis-api | train | js |
ee2b1a9070e4c49466b8a6c9f98bf7de23874934 | diff --git a/code/search/SearchForm.php b/code/search/SearchForm.php
index <HASH>..<HASH> 100644
--- a/code/search/SearchForm.php
+++ b/code/search/SearchForm.php
@@ -172,7 +172,8 @@ class SearchForm extends Form {
// legacy usage: $data was defaulting to $_REQUEST, parameter not passed in doc.silverstripe.org tutorials
if(!isset($data)) $data = $_REQUEST;
- return Convert::raw2xml($data['Search']);
+ // The form could be rendered without the search being done, so check for that.
+ if (isset($data['Search'])) return Convert::raw2xml($data['Search']);
}
/** | BUG Check for the parameter existence.
The specific situation is if the SearchForm.ss is overriden, and the
$SearchQuery parameter is used in the template. This will throw a Notice
in case the form is rendered without searching. | silverstripe_silverstripe-siteconfig | train | php |
41b185bbff76bced651440ff780e81eb811e7366 | diff --git a/cachestore/jdbc/src/main/java/org/infinispan/loaders/jdbc/connectionfactory/ManagedConnectionFactory.java b/cachestore/jdbc/src/main/java/org/infinispan/loaders/jdbc/connectionfactory/ManagedConnectionFactory.java
index <HASH>..<HASH> 100644
--- a/cachestore/jdbc/src/main/java/org/infinispan/loaders/jdbc/connectionfactory/ManagedConnectionFactory.java
+++ b/cachestore/jdbc/src/main/java/org/infinispan/loaders/jdbc/connectionfactory/ManagedConnectionFactory.java
@@ -99,8 +99,9 @@ public class ManagedConnectionFactory extends ConnectionFactory {
}
public void releaseConnection(Connection conn) {
- try {
- conn.close();
+ try {
+ if (conn != null) // Could be null if getConnection failed
+ conn.close();
} catch (SQLException e) {
log.warn("Issues while closing connection " + conn, e);
} | [ISPN-<I>] (ManagedConnectionFactory releaseConnection can throw NullPointerException) Fixed. | infinispan_infinispan | train | java |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.