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
db30b67dc570d59f964c2bd237d788d4f007e8d4
diff --git a/core/src/main/java/hudson/tasks/UserAvatarResolver.java b/core/src/main/java/hudson/tasks/UserAvatarResolver.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/tasks/UserAvatarResolver.java +++ b/core/src/main/java/hudson/tasks/UserAvatarResolver.java @@ -49,7 +49,7 @@ import hudson.model.User; * </pre> * * @author Erik Ramfelt - * @since 1.433 + * @since 1.434 */ public abstract class UserAvatarResolver implements ExtensionPoint {
Updated the since doc for UserAvatarResolver
jenkinsci_jenkins
train
java
283db9fcead2307e6d1122da4630fa750ad707e7
diff --git a/NetLicensingClient/netlicensing.php b/NetLicensingClient/netlicensing.php index <HASH>..<HASH> 100644 --- a/NetLicensingClient/netlicensing.php +++ b/NetLicensingClient/netlicensing.php @@ -43,7 +43,7 @@ class NetLicensing } $params = array( 'productNumber' => $productNumber, - 'name' => $licenseeName, + 'licenseeName' => $licenseeName, ); $url = self::NLIC_BASE_URL . '/licensee/' . $licenseeNumber . '/validate';
change licenseeName attribute according to the API <I>
Labs64_NetLicensingClient-php
train
php
d1e3baa537f4342dcf9e201983c6a656e8c1b4e1
diff --git a/src/Exscript/util/template.py b/src/Exscript/util/template.py index <HASH>..<HASH> 100644 --- a/src/Exscript/util/template.py +++ b/src/Exscript/util/template.py @@ -20,7 +20,7 @@ from Exscript.interpreter import Parser def _compile(conn, filename, template, parser_kwargs, **kwargs): if conn: - kwargs.update(conn.get_host().vars) + kwargs.update(conn.get_host().get_all()) # Init the parser. parser = Parser(**parser_kwargs)
fix: Exscript.util.template.run() on hosts that have no variables defined.
knipknap_exscript
train
py
dade7cb54bdf1500aae347e5d3cd2546a9ae9682
diff --git a/ubcpi/ubcpi.py b/ubcpi/ubcpi.py index <HASH>..<HASH> 100644 --- a/ubcpi/ubcpi.py +++ b/ubcpi/ubcpi.py @@ -127,7 +127,7 @@ class PeerInstructionXBlock(XBlock, MissingDataFetcherMixin): question_text = Dict( default={'text': 'What is your question?', 'image_url': '', 'image_position': 'below', 'show_image_fields': 0}, scope=Scope.content, - help="Some help text here change this" + help="The question the students see. This question appears above the possible answers which you set below. You can use text, an image or a combination of both. If you wish to add an image to your question, press the 'Add Image' button." ) options = List(
CHANGE the default help for the question_text Dict so now we can use this to output the help rather some some separate markup
ubc_ubcpi
train
py
b709ba76b4b60df8c116ad014807a09a02eb4239
diff --git a/src/Plugin/plugin.helper.functions.php b/src/Plugin/plugin.helper.functions.php index <HASH>..<HASH> 100644 --- a/src/Plugin/plugin.helper.functions.php +++ b/src/Plugin/plugin.helper.functions.php @@ -21,7 +21,15 @@ const PLUGIN_FQCN_TEMPLATE = 'Moka\\Plugin\\%s\\%sPlugin'; */ function loadPlugin(string $pluginName): MockingStrategyInterface { - $pluginFQCN = generateFQCN($pluginName); + $generateFQCN = function (string $pluginName): string { + return sprintf( + PLUGIN_FQCN_TEMPLATE, + ucfirst($pluginName), + ucfirst($pluginName) + ); + }; + + $pluginFQCN = $generateFQCN($pluginName); if ( !class_exists($pluginFQCN) || @@ -37,18 +45,4 @@ function loadPlugin(string $pluginName): MockingStrategyInterface /** @var PluginInterface $pluginFQCN */ return $pluginFQCN::getStrategy(); -} - - -/** - * @param string $pluginName - * @return string - */ -function generateFQCN(string $pluginName): string -{ - return sprintf( - PLUGIN_FQCN_TEMPLATE, - ucfirst($pluginName), - ucfirst($pluginName) - ); -} +} \ No newline at end of file
Encapsulate in a private context the function 'generateFQCn'
facile-it_moka
train
php
6fef786cf390596a80cf79b168dbe27bc3b59c35
diff --git a/core/src/main/java/org/infinispan/configuration/global/GlobalConfigurationBuilder.java b/core/src/main/java/org/infinispan/configuration/global/GlobalConfigurationBuilder.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/infinispan/configuration/global/GlobalConfigurationBuilder.java +++ b/core/src/main/java/org/infinispan/configuration/global/GlobalConfigurationBuilder.java @@ -33,7 +33,9 @@ public class GlobalConfigurationBuilder implements GlobalConfigurationChildBuild public GlobalConfigurationBuilder() { // In OSGi contexts the TCCL should not be used. Use the infinispan-core bundle as default instead. - ClassLoader defaultCL = Util.isOSGiContext() ? GlobalConfigurationBuilder.class.getClassLoader() : Thread.currentThread().getContextClassLoader(); + ClassLoader defaultCL = null; + if (!Util.isOSGiContext()) defaultCL = Thread.currentThread().getContextClassLoader(); + if (defaultCL == null) defaultCL = GlobalConfigurationBuilder.class.getClassLoader(); this.cl = new WeakReference<ClassLoader>(defaultCL); this.transport = new TransportConfigurationBuilder(this); this.globalJmxStatistics = new GlobalJmxStatisticsConfigurationBuilder(this);
ISPN-<I> Resolve classes properly when Thread context classloader is null If TCCL is null, fallback to ISPN classes classloader
infinispan_infinispan
train
java
89b5959128a91b5aceb46764ff2867cf49aa2cb6
diff --git a/ml-agents/mlagents/trainers/tests/test_simple_rl.py b/ml-agents/mlagents/trainers/tests/test_simple_rl.py index <HASH>..<HASH> 100644 --- a/ml-agents/mlagents/trainers/tests/test_simple_rl.py +++ b/ml-agents/mlagents/trainers/tests/test_simple_rl.py @@ -365,12 +365,12 @@ def test_simple_asymm_ghost(use_discrete): [BRAIN_NAME + "?team=0", brain_name_opp + "?team=1"], use_discrete=use_discrete ) override_vals = { - "max_steps": 2000, + "max_steps": 4000, "self_play": { "play_against_latest_model_ratio": 1.0, - "save_steps": 5000, - "swap_steps": 5000, - "team_change": 2000, + "save_steps": 10000, + "swap_steps": 10000, + "team_change": 4000, }, } config = generate_config(PPO_CONFIG, override_vals)
Increasing steps on asymmetric ghost test (#<I>)
Unity-Technologies_ml-agents
train
py
ea886d5544b14b228a184dc7f30c727b10a7281d
diff --git a/TYPO3.Flow/Classes/Http/Response.php b/TYPO3.Flow/Classes/Http/Response.php index <HASH>..<HASH> 100644 --- a/TYPO3.Flow/Classes/Http/Response.php +++ b/TYPO3.Flow/Classes/Http/Response.php @@ -358,8 +358,8 @@ class Response implements ResponseInterface{ /** * Cast the response to a string: return the content part of this response * - * @return string The same as getContent() - * @api + * @return string The same as getContent() + * @api */ public function __toString() { return $this->getContent();
[TASK] Annotation cleanup for http response __toString method Change-Id: Ice5a<I>fad<I>a4a<I>be<I>a9d7d<I>d3e0f<I>c Related: #<I> Releases: <I>, <I> Original-Commit-Hash: a2e8c<I>edcc<I>cdf<I>d<I>fc<I>e5ca2daf6
neos_flow-development-collection
train
php
322a5f6301cc364a7a3f0cc7000a857e583e224b
diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index <HASH>..<HASH> 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -1128,10 +1128,15 @@ class grade_report_grader extends grade_report { global $USER; $iconshtml = ''; - if ($USER->gradeediting[$this->courseid]) { + if ($USER->gradeediting[$this->courseid]) { + + $colspan=''; + if ($this->get_pref('showuseridnumber')) { + $colspan = 'colspan="2" '; + } $iconshtml = '<tr class="r'.$this->rowcount++.'">' - . '<th class="header c0 range" scope="row">'.$this->get_lang_string('controls','grades').'</th>'; + . '<th class="header c0 range" scope="row" '.$colspan.'>'.$this->get_lang_string('controls','grades').'</th>'; $columncount = 1; foreach ($this->gtree->items as $itemid=>$unused) {
MDL-<I> Grader report: Showing idnumber column shifts controls into wrong columns; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
02c5698401d336838dcc2ba7eb83b911872bd1a1
diff --git a/rollbar/__init__.py b/rollbar/__init__.py index <HASH>..<HASH> 100644 --- a/rollbar/__init__.py +++ b/rollbar/__init__.py @@ -156,7 +156,7 @@ SETTINGS = { }, 'allow_logging_basic_config': True, # set to False to avoid a call to logging.basicConfig() 'locals': { - 'enabled': False, + 'enabled': True, 'sizes': DEFAULT_LOCALS_SIZES } }
enable locals by default for <I> @brianr
rollbar_pyrollbar
train
py
9ec6bb21c3b15b6c88ed00baffa3bbaf7b731135
diff --git a/generator/classes/propel/phing/AbstractPropelDataModelTask.php b/generator/classes/propel/phing/AbstractPropelDataModelTask.php index <HASH>..<HASH> 100644 --- a/generator/classes/propel/phing/AbstractPropelDataModelTask.php +++ b/generator/classes/propel/phing/AbstractPropelDataModelTask.php @@ -536,7 +536,8 @@ abstract class AbstractPropelDataModelTask extends Task { **/ protected function includeExternalSchemas(DomDocument $dom, $srcDir) { $databaseNode = $dom->getElementsByTagName("database")->item(0); - foreach ($dom->getElementsByTagName("external-schema") as $externalSchema) { + $externalSchemaNodes = $dom->getElementsByTagName("external-schema"); + while ($externalSchema = $externalSchemaNodes->item(0)) { $include = $externalSchema->getAttribute("filename"); $externalSchema->parentNode->removeChild($externalSchema); $externalSchemaFile = new PhingFile($srcDir, $include);
Iterating over DOM nodes gets messed up when you remove nodes that are in the collection. This lead to skipping the next external-schema reference and thus missing definitions in schema-transformed.xml.
propelorm_Propel
train
php
e2f2099197b27d5135129807b3c1b8ad6e8f5463
diff --git a/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java b/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java index <HASH>..<HASH> 100644 --- a/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java @@ -179,6 +179,17 @@ public class SpringApplicationBuilderTests { } @Test + public void parentFirstWithDifferentProfile() throws Exception { + SpringApplicationBuilder application = new SpringApplicationBuilder( + ExampleConfig.class).profiles("node").properties("transport=redis") + .child(ChildConfig.class).profiles("admin").web(false); + this.context = application.run(); + assertThat(this.context.getEnvironment().acceptsProfiles("node"), is(true)); + assertThat(this.context.getParent().getEnvironment().acceptsProfiles("admin"), + is(false)); + } + + @Test public void parentContextIdentical() throws Exception { SpringApplicationBuilder application = new SpringApplicationBuilder( ExampleConfig.class);
Add test for gh-<I>
spring-projects_spring-boot
train
java
028a2d9b32363af28755eafdab635a9e0382252d
diff --git a/src/ansiblelint/file_utils.py b/src/ansiblelint/file_utils.py index <HASH>..<HASH> 100644 --- a/src/ansiblelint/file_utils.py +++ b/src/ansiblelint/file_utils.py @@ -209,7 +209,13 @@ class Lintable: def _populate_content_cache_from_disk(self) -> None: # Can raise UnicodeDecodeError - self._content = self.path.resolve().read_text(encoding="utf-8") + try: + self._content = self.path.resolve().read_text(encoding="utf-8") + except FileNotFoundError as ex: + if vars(options).get("progressive"): + self._content = "" + else: + raise ex if self._original_content is None: self._original_content = self._content
Handle FileNotFoundError caused by processing new file in progressive mode (#<I>)
ansible_ansible-lint
train
py
65b18df24064018f0f3e8495b244c9209a48d814
diff --git a/Routes.php b/Routes.php index <HASH>..<HASH> 100644 --- a/Routes.php +++ b/Routes.php @@ -10,6 +10,7 @@ namespace Brain; +use Brain\Cortex\Group\GroupCollection; use Brain\Cortex\Group\GroupCollectionInterface; use Brain\Cortex\Route\PriorityRouteCollection; use Brain\Cortex\Route\RouteCollectionInterface;
Add missing use statement in Brain\Routes
Brain-WP_Cortex
train
php
fb3950e235bd17dcc7a971b25a8a9bb03aa6f99c
diff --git a/cmds/tfa.js b/cmds/tfa.js index <HASH>..<HASH> 100644 --- a/cmds/tfa.js +++ b/cmds/tfa.js @@ -58,9 +58,8 @@ async function enable (argv) { } let challenge = await profile.set(info, argv.registry, {token, otp: argv.otp}) if (challenge.tfa === null) { - let result = await profile.set({tfa: {password, mode: 'disable'}}, argv.registry, {token, otp: argv.otp}) - console.log(result) - challenge = await profile.set(info, argv.registry, {token, otp: argv.otp}) + console.log('Two factor auth mode changed to: ' + argv.mode) + return } if (typeof challenge.tfa !== 'string' || !/^otpauth:[/][/]/.test(challenge.tfa)) { console.error('Unknown error enabling two-factor authentication. Expected otpauth URL, got:', challenge.tfa)
A null response from a tfa set means it changed modes, no error
npm_npm-profile
train
js
0b44355a6255857b94574c8e6cb685c57bef6f0e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ from setuptools import setup, find_packages from numpy.distutils.core import setup, Extension from os import path import io -import os +import os, subprocess ## in development set version to none and ...
Update setup.py Good grief. Will this never end ?
underworldcode_stripy
train
py
1894a208bd3c0b1d31d372aab726726e60becc2d
diff --git a/discovery/utils.go b/discovery/utils.go index <HASH>..<HASH> 100644 --- a/discovery/utils.go +++ b/discovery/utils.go @@ -10,7 +10,7 @@ import ( "github.com/roasbeef/btcd/btcec" ) -// newProofKey constructs new announcement signature message key. +// newProofKey constructs a new announcement signature message key. func newProofKey(chanID uint64, isRemote bool) waitingProofKey { return waitingProofKey{ chanID: chanID, @@ -18,9 +18,9 @@ func newProofKey(chanID uint64, isRemote bool) waitingProofKey { } } -// ToBytes represents the key in the byte format. +// ToBytes returns a serialized representation of the key. func (k waitingProofKey) ToBytes() []byte { - var key [10]byte + var key [9]byte var b uint8 if k.isRemote { @@ -29,8 +29,8 @@ func (k waitingProofKey) ToBytes() []byte { b = 1 } - binary.BigEndian.PutUint64(key[:], k.chanID) - key[9] = b + binary.BigEndian.PutUint64(key[:8], k.chanID) + key[8] = b return key[:] }
discovery: utilize exactly 9 bytes for serialized waitingProofKey
lightningnetwork_lnd
train
go
b4fd1b59a14a0027980e62b9827eb58341c5d6e1
diff --git a/src/Cache/ApcCache.php b/src/Cache/ApcCache.php index <HASH>..<HASH> 100644 --- a/src/Cache/ApcCache.php +++ b/src/Cache/ApcCache.php @@ -44,7 +44,8 @@ class ApcCache implements CacheInterface { $cache = apc_cache_info('user'); foreach($cache['cache_list'] as $entry) { - if(strpos($entry['info'], 'minime-annotations:') === 0) { + if(isset($entry['info']) + && strpos($entry['info'], 'minime-annotations:') === 0) { apc_delete($entry['info']); } }
patch to keep ApcCache handler compatible with HHVM #<I>
marcioAlmada_annotations
train
php
da3d4acd11dcf052f754634500560eb2504120d1
diff --git a/cosmic_ray/version.py b/cosmic_ray/version.py index <HASH>..<HASH> 100644 --- a/cosmic_ray/version.py +++ b/cosmic_ray/version.py @@ -1,3 +1,3 @@ """Cosmic Ray version info.""" -__version__ = '2.0.0a0' +__version__ = '2.0.1'
bumped version to <I>
sixty-north_cosmic-ray
train
py
2a82cacf0bab6fbc50957b826914d364170b5dcb
diff --git a/lib/xmldb/classes/generators/XMLDBGenerator.class.php b/lib/xmldb/classes/generators/XMLDBGenerator.class.php index <HASH>..<HASH> 100644 --- a/lib/xmldb/classes/generators/XMLDBGenerator.class.php +++ b/lib/xmldb/classes/generators/XMLDBGenerator.class.php @@ -668,7 +668,7 @@ class XMLDBgenerator { $rename = str_replace('TABLENAME', $this->getTableName($xmldb_table), $this->rename_column_sql); $rename = str_replace('OLDFIELDNAME', $this->getEncQuoted($xmldb_field->getName()), $rename); - $rename = str_replace('NEWFIELDNAME', $this->getEncQuoted($newname)), $rename); + $rename = str_replace('NEWFIELDNAME', $this->getEncQuoted($newname), $rename); $results[] = $rename;
getting tired of restore my test Oracle DB. Typo!
moodle_moodle
train
php
60261b8c598512a5cfde8b1e8b0b49c1907dcce5
diff --git a/lang/en/moodle.php b/lang/en/moodle.php index <HASH>..<HASH> 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -785,7 +785,7 @@ $string['forgotteninvalidurl'] = 'Invalid password reset URL'; $string['format'] = 'Format'; $string['format_help'] = 'The course format determines the layout of the course page. -* SCORM format - For displaying a SCORM package in the first section of the course page (as an alternative to using the SCORM/AICC module) +* Single activity format - For displaying a single activity or resource (such as a Quiz or SCORM package) on the course page * Social format - A forum is displayed on the course page * Topics format - The course page is organised into topic sections * Weekly format - The course page is organised into weekly sections, with the first week starting on the course start date';
MDL-<I> course: Changed help string for course format selection
moodle_moodle
train
php
ab93bf496ac46c704305e71fb1b83a337457eed0
diff --git a/src/utilities/findBreakingChanges.js b/src/utilities/findBreakingChanges.js index <HASH>..<HASH> 100644 --- a/src/utilities/findBreakingChanges.js +++ b/src/utilities/findBreakingChanges.js @@ -8,6 +8,7 @@ */ import find from '../polyfills/find'; +import inspect from '../jsutils/inspect'; import { type GraphQLNamedType, type GraphQLFieldMap, @@ -292,7 +293,10 @@ function typeKindName(type: GraphQLNamedType): string { if (isInputObjectType(type)) { return 'an Input type'; } - throw new TypeError('Unknown type ' + type.constructor.name); + + // Not reachable. All possible named types have been considered. + /* istanbul ignore next */ + throw new TypeError(`Unexpected type: ${inspect((type: empty))}.`); } function findFieldsThatChangedTypeOnObjectOrInterfaceTypes(
findBreakingChanges: Correctly document not reachable statement (#<I>)
graphql_graphql-js
train
js
7a1b70204ef427ea6052609bb55b586dfd2fa4ad
diff --git a/lib/bibliothecary/parsers/go.rb b/lib/bibliothecary/parsers/go.rb index <HASH>..<HASH> 100644 --- a/lib/bibliothecary/parsers/go.rb +++ b/lib/bibliothecary/parsers/go.rb @@ -146,7 +146,7 @@ module Bibliothecary def self.parse_go_resolved(file_contents) JSON.parse(file_contents) - .select { |dep| dep["Main"] == "false" } + .select { |dep| dep["Main"] != "true" } .map { |dep| { name: dep["Path"], requirement: dep["Version"], type: 'runtime' } } end
change to check for not true instead of == to false
librariesio_bibliothecary
train
rb
0013c25f1a0e50a43bfd015accabbe5f519bb7db
diff --git a/app-web/WebSocketOverCOMET.php b/app-web/WebSocketOverCOMET.php index <HASH>..<HASH> 100644 --- a/app-web/WebSocketOverCOMET.php +++ b/app-web/WebSocketOverCOMET.php @@ -246,7 +246,7 @@ class WebSocketOverCOMET_Request extends Request $this->atime = time(); $this->finish(0,TRUE); } - if ($this->atime < time()-10) + if ($this->atime < time()-30) { if (isset($this->downstream)) { @@ -288,9 +288,9 @@ class WebSocketOverCOMET_Request extends Request $a[] = $this->idAppQueue; unset($a); $this->out("\n"); - $this->sleep(1); + $this->sleep(15); } - $this->sleep(10); + return Request::DONE; } } /* @method onAbort
Minor improvements in app-web/WebSocketOverCOMET.php
kakserpom_phpdaemon
train
php
7772d50f742dbf9cb9ffe2f610e18f3898da0453
diff --git a/cmd/torrent/download.go b/cmd/torrent/download.go index <HASH>..<HASH> 100644 --- a/cmd/torrent/download.go +++ b/cmd/torrent/download.go @@ -234,10 +234,11 @@ func downloadErr(flags downloadFlags) error { clientConfig.SetListenAddr(flags.Addr) } if flags.UploadRate != nil { + // TODO: I think the upload rate limit could be much lower. clientConfig.UploadRateLimiter = rate.NewLimiter(rate.Limit(*flags.UploadRate), 256<<10) } if flags.DownloadRate != nil { - clientConfig.DownloadRateLimiter = rate.NewLimiter(rate.Limit(*flags.DownloadRate), 1<<20) + clientConfig.DownloadRateLimiter = rate.NewLimiter(rate.Limit(*flags.DownloadRate), 1<<16) } if flags.Quiet { clientConfig.Logger = log.Discard
cmd/torrent: Lower burst when there's a download rate limit
anacrolix_torrent
train
go
13f2b089194a93a126929a358de397e16c738c15
diff --git a/src/Utils/Logger.php b/src/Utils/Logger.php index <HASH>..<HASH> 100644 --- a/src/Utils/Logger.php +++ b/src/Utils/Logger.php @@ -24,7 +24,7 @@ class Logger { } protected function init($root) { - $loggerFile = $root.'console/log/' . date('Y-m-d') . '.log'; + $loggerFile = $root.'/console/log/' . date('Y-m-d') . '.log'; if (!is_file($loggerFile)) { try { $directoryName = dirname($loggerFile);
Fix logger path (#<I>) * [console] Read alias as array. * [console] Remove no longer required instruction. * [logger] Fix log file path.
hechoendrupal_drupal-console
train
php
a2fc8da1e822c7f7546cf38aeccd6dc55fdb4260
diff --git a/luigi/file.py b/luigi/file.py index <HASH>..<HASH> 100644 --- a/luigi/file.py +++ b/luigi/file.py @@ -8,6 +8,12 @@ class File(object): return os.path.exists(self.__path) def open(self, mode = 'r'): + if mode == 'w' or mode == 'a': + # Create folder if it does not exist + normpath = os.path.normpath(self.__path) + parentfolder = os.path.dirname(normpath) + if not os.path.exists(parentfolder): + os.makedirs(parentfolder) return open(self.__path, mode) def remove(self):
LocalTarget and File create folder while creating a new file Change-Id: Ie8e2ba3bf<I>ed<I>c<I>b<I>e<I>
spotify_luigi
train
py
7f14f7e49170819e8e3ae4ff9c4303168bac0cca
diff --git a/core/src/main/java/org/bitcoinj/utils/Threading.java b/core/src/main/java/org/bitcoinj/utils/Threading.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/bitcoinj/utils/Threading.java +++ b/core/src/main/java/org/bitcoinj/utils/Threading.java @@ -20,6 +20,7 @@ import com.google.common.util.concurrent.CycleDetectingLockFactory; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.Uninterruptibles; +import org.bitcoinj.core.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -152,7 +153,10 @@ public class Threading { public static CycleDetectingLockFactory factory; public static ReentrantLock lock(String name) { - return factory.newReentrantLock(name); + if (Utils.isAndroidRuntime()) + return new ReentrantLock(true); + else + return factory.newReentrantLock(name); } public static void warnOnLockCycles() {
On Android, use non-cycle detecting locks with fairness activated (experimental)
bitcoinj_bitcoinj
train
java
988197c7954d6e4123c1650cab090ba8f529d6f9
diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index <HASH>..<HASH> 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -158,9 +158,9 @@ class TempPathFactory: def get_user() -> Optional[str]: """Return the current user name, or None if getuser() does not work in the current environment (see #1010).""" - import getpass - try: + # In some exotic environments, getpass may not be importable. + import getpass return getpass.getuser() except (ImportError, KeyError): return None
fix: move 'import getpass' statement to try-clause
pytest-dev_pytest
train
py
26de3cc37be2abdd9ca1b8f9fb5996d8318a1001
diff --git a/lib/fastlane/actions/hockey.rb b/lib/fastlane/actions/hockey.rb index <HASH>..<HASH> 100644 --- a/lib/fastlane/actions/hockey.rb +++ b/lib/fastlane/actions/hockey.rb @@ -112,6 +112,10 @@ module Fastlane FastlaneCore::ConfigItem.new(key: :tags, env_name: "FL_HOCKEY_TAGS", description: "Comma separated list of tags which will receive access to the build", + optional: true), + FastlaneCore::ConfigItem.new(key: :public_identifier, + env_name: "FL_HOCKEY_PUBLIC_IDENTIFIER", + description: "Public identifier of the app you are targeting, usually you won't need this value", optional: true) ] end
Added new public_identifier option to hockey integration
fastlane_fastlane
train
rb
aa162a3caf3d0303080ca81ad70d83d70c314ae1
diff --git a/lib/cisco_node_utils/version.rb b/lib/cisco_node_utils/version.rb index <HASH>..<HASH> 100644 --- a/lib/cisco_node_utils/version.rb +++ b/lib/cisco_node_utils/version.rb @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2017 Cisco and/or its affiliates. +# Copyright (c) 2015-2018 Cisco and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # Container module for version number only. module CiscoNodeUtils - VERSION = '1.9.0-dev' + VERSION = '1.9.0' gem_version = Gem::Version.new(Gem::VERSION) min_gem_version = Gem::Version.new('2.1.0') fail 'Required rubygems version >= 2.1.0' if gem_version < min_gem_version
Update version to be <I>
cisco_cisco-network-node-utils
train
rb
f5231f456a4f2cb881260372abd680b0d41045a9
diff --git a/framework/base/interfaces.php b/framework/base/interfaces.php index <HASH>..<HASH> 100644 --- a/framework/base/interfaces.php +++ b/framework/base/interfaces.php @@ -337,8 +337,8 @@ interface IAuthManager { /** * Performs access check for the specified user. - * @param string $itemName the name of the operation that need access check - * @param mixed $userId the user ID. This should can be either an integer and a string representing + * @param string $itemName the name of the operation that we are checking access to + * @param mixed $userId the user ID. This should be either an integer or a string representing * the unique identifier of a user. See {@link IWebUser::getId}. * @param array $params name-value pairs that would be passed to biz rules associated * with the tasks and roles assigned to the user.
Fixes #<I>. API doc adjustments.
yiisoft_yii
train
php
aed0bc8b5d935c74472b2035e96a1671752814bf
diff --git a/sanitize_test.go b/sanitize_test.go index <HASH>..<HASH> 100644 --- a/sanitize_test.go +++ b/sanitize_test.go @@ -1795,3 +1795,43 @@ func TestIssue111ScriptTags(t *testing.T) { ) } } + +func TestQuotes(t *testing.T) { + p := UGCPolicy() + + tests := []test{ + { + in: `noquotes`, + expected: `noquotes`, + }, + { + in: `"singlequotes"`, + expected: `&#34;singlequotes&#34;`, + }, + { + in: `""doublequotes""`, + expected: `&#34;&#34;doublequotes&#34;&#34;`, + }, + } + + // These tests are run concurrently to enable the race detector to pick up + // potential issues + wg := sync.WaitGroup{} + wg.Add(len(tests)) + for ii, tt := range tests { + go func(ii int, tt test) { + out := p.Sanitize(tt.in) + if out != tt.expected { + t.Errorf( + "test %d failed;\ninput : %s\noutput : %s\nexpected: %s", + ii, + tt.in, + out, + tt.expected, + ) + } + wg.Done() + }(ii, tt) + } + wg.Wait() +}
Add test for quotes to prevent regression on the ASCII SCRIPT issue
microcosm-cc_bluemonday
train
go
b63973ef61ffd4d89aea4bd59303cdf05ce690e9
diff --git a/acos_client/v30/action.py b/acos_client/v30/action.py index <HASH>..<HASH> 100644 --- a/acos_client/v30/action.py +++ b/acos_client/v30/action.py @@ -20,13 +20,18 @@ from acos_client.v30 import base class Action(base.BaseV30): - def write_memory(self, partition="all", destination="primary", **kwargs): + def write_memory(self, partition="all", destination="primary", specified_partition=None, **kwargs): payload = { "memory": { "destination": destination, "partition": partition } } + + if specified_partition: + del payload["memory"]["destination"] + payload["memory"]["specified-partition"] = specified_partition + try: try: self._post("/write/memory/", payload, **kwargs)
Updated acos-client to match current AXAPI write memory spec
a10networks_acos-client
train
py
ac36001fdaa657f5fd45fbde69637d71f402c8fa
diff --git a/src/de/mrapp/android/preference/activity/PreferenceHeader.java b/src/de/mrapp/android/preference/activity/PreferenceHeader.java index <HASH>..<HASH> 100644 --- a/src/de/mrapp/android/preference/activity/PreferenceHeader.java +++ b/src/de/mrapp/android/preference/activity/PreferenceHeader.java @@ -441,7 +441,9 @@ public class PreferenceHeader implements Parcelable { TextUtils.writeToParcel(getSummary(), dest, flags); TextUtils.writeToParcel(getBreadCrumbTitle(), dest, flags); TextUtils.writeToParcel(getBreadCrumbShortTitle(), dest, flags); - dest.writeParcelable(((BitmapDrawable) getIcon()).getBitmap(), flags); + Bitmap bitmap = (getIcon() != null && getIcon() instanceof BitmapDrawable) ? ((BitmapDrawable) getIcon()) + .getBitmap() : null; + dest.writeParcelable(bitmap, flags); dest.writeString(getFragment()); dest.writeBundle(getExtras());
Avoided NPE when no icon is set.
michael-rapp_AndroidPreferenceActivity
train
java
134cacf1b7ca8a030e38af0645c3b1d72f65a4f8
diff --git a/admin/settings/mnet.php b/admin/settings/mnet.php index <HASH>..<HASH> 100644 --- a/admin/settings/mnet.php +++ b/admin/settings/mnet.php @@ -1,5 +1,5 @@ <?php -require_once($CFG->dirroot.'/mnet/lib.php'); + // This file defines settingpages and externalpages under the "mnet" category if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
rating MDL-<I> Removed accidental commit of an unrelated mnet work around
moodle_moodle
train
php
1aa251dc6b3c27df6e466caf3182dedfa9c3c5e2
diff --git a/src/renderable/camera.js b/src/renderable/camera.js index <HASH>..<HASH> 100644 --- a/src/renderable/camera.js +++ b/src/renderable/camera.js @@ -65,7 +65,6 @@ follow_axis : 0, // shake parameters - shaking : false, _shake : null, // fade parameters _fadeIn : null, @@ -287,10 +286,10 @@ var updated = this.updateTarget(); - if (this.shaking === true) { + if (this._shake.duration > 0) { this._shake.duration -= dt; if (this._shake.duration <= 0) { - this.shaking = false; + this._shake.duration = 0; this.offset.setZero(); if (typeof(this._shake.onComplete) === "function") { this._shake.onComplete(); @@ -337,16 +336,14 @@ * me.game.viewport.shake(10, 500, me.game.viewport.AXIS.BOTH); */ shake : function(intensity, duration, axis, onComplete) { - if (this.shaking) + if (this._shake.duration > 0) return; - this.shaking = true; - this._shake = { intensity : intensity, duration : duration, axis : axis || this.AXIS.BOTH, - onComplete : onComplete || null + onComplete : onComplete }; },
Cleaned the shaking function the `shaking` flag is useless now that we can check it using the remaining duration
melonjs_melonJS
train
js
50eeef47c5cc4523b84368be58be8e876c85109e
diff --git a/src/android/org/jboss/aerogear/cordova/push/PushPlugin.java b/src/android/org/jboss/aerogear/cordova/push/PushPlugin.java index <HASH>..<HASH> 100644 --- a/src/android/org/jboss/aerogear/cordova/push/PushPlugin.java +++ b/src/android/org/jboss/aerogear/cordova/push/PushPlugin.java @@ -58,7 +58,7 @@ public class PushPlugin extends CordovaPlugin { private static CordovaWebView webViewReference; private static String javascriptCallback; private static Bundle cachedExtras = null; - private static boolean foreground = true; + private static boolean foreground = false; private SharedPreferences preferences; @@ -85,6 +85,8 @@ public class PushPlugin extends CordovaPlugin { Log.v(TAG, "execute: action=" + action); + foreground = true; + if (REGISTER.equals(action)) { Log.v(TAG, "execute: data=" + data.toString());
Fix for AGPUSH<I> - create notification when app is closed.
aerogear_aerogear-cordova-push
train
java
1b624dfe309a0ef54dbf546cd56ccfe933b30ca8
diff --git a/Eloquent/Builder.php b/Eloquent/Builder.php index <HASH>..<HASH> 100755 --- a/Eloquent/Builder.php +++ b/Eloquent/Builder.php @@ -1004,7 +1004,7 @@ class Builder $qualifiedColumn = end($segments).'.'.$column; - $values[$qualifiedColumn] = $values[$column]; + $values[$qualifiedColumn] = Arr::get($values, $qualifiedColumn, $values[$column]); unset($values[$column]);
fix updated with provided qualified updated_at (#<I>)
illuminate_database
train
php
0b6602e1039b2df65ba03382165d913187e727a0
diff --git a/lib/massa/tool.rb b/lib/massa/tool.rb index <HASH>..<HASH> 100644 --- a/lib/massa/tool.rb +++ b/lib/massa/tool.rb @@ -4,7 +4,13 @@ module Massa class Tool class << self def list - YAML.load_file(config_file_from_gem).merge YAML.load_file(config_file_from_project) + default_tools = YAML.load_file(config_file_from_gem) + + if File.exist?(config_file_from_project) + default_tools.merge YAML.load_file(config_file_from_project) + else + default_tools + end end def config_file_from_gem
Fixing 'Tool#list' method when custom config file is not present
lucascaton_massa
train
rb
200a74cd1b36d8547c5755609a9e27505c16a453
diff --git a/lib/ansiblereview/__main__.py b/lib/ansiblereview/__main__.py index <HASH>..<HASH> 100755 --- a/lib/ansiblereview/__main__.py +++ b/lib/ansiblereview/__main__.py @@ -94,5 +94,5 @@ def main(): info("Reviewing all of %s" % candidate, options) errors = errors + candidate.review(options, lines) else: - warn("Couldn't classify file %s" % filename, options) + info("Couldn't classify file %s" % filename, options) return errors
PR: for #<I> do not warn for not classified files (#<I>)
willthames_ansible-review
train
py
4283706c45bd8eab27a7e926b2a7c5249d070bbf
diff --git a/great_expectations/render/renderer/site_builder.py b/great_expectations/render/renderer/site_builder.py index <HASH>..<HASH> 100644 --- a/great_expectations/render/renderer/site_builder.py +++ b/great_expectations/render/renderer/site_builder.py @@ -62,7 +62,7 @@ class SiteBuilder(object): class_name: DefaultSiteIndexBuilder # Verbose version: - # index_builder: + # site_index_builder: # module_name: great_expectations.render.builder # class_name: DefaultSiteIndexBuilder # renderer:
fix a description that may be misleading (#<I>)
great-expectations_great_expectations
train
py
903904d33bbcf613cbb1abf746342dac7bbf3038
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,12 +1,15 @@ $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'support')) require 'fileutils' require 'mailman' require 'rspec' -require 'pop3_mock' require 'maildir' +# Require all files in spec/support (Mocks, helpers, etc.) +Dir[File.join(File.dirname(__FILE__), "support", "**", "*.rb")].each do |f| + require File.expand_path(f) +end + unless defined?(SPEC_ROOT) SPEC_ROOT = File.join(File.dirname(__FILE__)) end
Require all files in spec/support
mailman_mailman
train
rb
17562c85ee175f4206e77684456ee92e81112e31
diff --git a/django_x509/base/admin.py b/django_x509/base/admin.py index <HASH>..<HASH> 100644 --- a/django_x509/base/admin.py +++ b/django_x509/base/admin.py @@ -99,7 +99,8 @@ class AbstractCaAdmin(BaseAdmin): 'modified'] class Media: - js = ('django-x509/js/x509-admin.js',) + js = ('admin/js/jquery.init.js', + 'django-x509/js/x509-admin.js',) def get_urls(self): return [ @@ -150,7 +151,8 @@ class AbstractCertAdmin(BaseAdmin): actions = ['revoke_action'] class Media: - js = ('django-x509/js/x509-admin.js',) + js = ('admin/js/jquery.init.js', + 'django-x509/js/x509-admin.js',) def ca_url(self, obj): url = reverse('admin:{0}_ca_change'.format(self.opts.app_label), args=[obj.ca.pk])
[bug] Fix JavaScript error on django <I> #<I> This commit fixes JS error on django <I>. Changes: - added pointer to `jquery.init.js` in admin.py `Media` classes according to django <I> release notes Fixes #<I>
openwisp_django-x509
train
py
98fc2e0cdd396a063d23c5af8419726439b03e76
diff --git a/src/Util.php b/src/Util.php index <HASH>..<HASH> 100644 --- a/src/Util.php +++ b/src/Util.php @@ -384,21 +384,6 @@ final class Util if ($length < 1) { return ''; } - - /** - * @var array<int, int> - */ - $leftInt = self::stringToIntArray($left); - - /** - * @var array<int, int> - */ - $rightInt = self::stringToIntArray($right); - - $output = ''; - for ($i = 0; $i < $length; ++$i) { - $output .= self::intToChr($leftInt[$i] ^ $rightInt[$i]); - } - return $output; + return (string) ($left ^ $right); } }
XORing two strings together need not be explicitly written out.
paragonie_halite
train
php
f0fb96fd02a222c747e60ce7b82a08f7fa0c18a0
diff --git a/alot/errors.py b/alot/errors.py index <HASH>..<HASH> 100644 --- a/alot/errors.py +++ b/alot/errors.py @@ -3,7 +3,7 @@ # For further details see the COPYING file -class GPGCode: +class GPGCode(object): AMBIGUOUS_NAME = 1 NOT_FOUND = 2 BAD_PASSPHRASE = 3
Turn alot.errors.GPGCode into a new style class
pazz_alot
train
py
65969012c23292fa8a85cf86ff6fce00e3a6f0b3
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -85,12 +85,13 @@ module.exports = function(grunt){ ], }, dist: { - files: "scss/*.scss", + files: "flexout.scss", tasks: ["sass", "autoprefixer", "cssmin"] }, docs: { files: "docs/scss/*.scss", - tasks: ["sass:docs", "autoprefixer:docs", "cssmin:docs"] + // tasks: ["sass:docs", "autoprefixer:docs", "cssmin:docs"] + tasks: ["sass:docs", "autoprefixer:docs"] } } });
fix sass file watcher
arisunarya_flexout
train
js
a659ab90cc06a9a78852bfdf79f0892edf1e2da3
diff --git a/onnx/test/schema_test.py b/onnx/test/schema_test.py index <HASH>..<HASH> 100644 --- a/onnx/test/schema_test.py +++ b/onnx/test/schema_test.py @@ -5,10 +5,10 @@ from onnx import defs, AttributeProto class TestSchema(unittest.TestCase): - def test_get_schema(self): + def test_get_schema(self): # type: () -> None defs.get_schema("Relu") - def test_typecheck(self): + def test_typecheck(self): # type: () -> None defs.get_schema("Conv") def test_attr_default_value(self):
Add type hints to schema_test.py (#<I>)
onnx_onnx
train
py
660043043d8d3400fa7c83596c77edad77eccaba
diff --git a/rest_framework_gis/serializers.py b/rest_framework_gis/serializers.py index <HASH>..<HASH> 100644 --- a/rest_framework_gis/serializers.py +++ b/rest_framework_gis/serializers.py @@ -49,7 +49,7 @@ class GeoFeatureModelSerializer(GeoModelSerializer): # if 'fields' are declared, make sure it includes 'geo_field' if self.opts.fields: if self.opts.geo_field not in self.opts.fields: - self.opts.fields = list(self.opts.fields) + #self.opts.fields = list(self.opts.fields) self.opts.fields.append(self.opts.geo_field)
allow for list or tuple of field names
djangonauts_django-rest-framework-gis
train
py
325f4b6b6ff929c9d3a08fc2d717720ec611459c
diff --git a/core/model/ErrorPage.php b/core/model/ErrorPage.php index <HASH>..<HASH> 100755 --- a/core/model/ErrorPage.php +++ b/core/model/ErrorPage.php @@ -58,7 +58,8 @@ class ErrorPage extends Page { function requireDefaultRecords() { parent::requireDefaultRecords(); - if(!DataObject::get_one('ErrorPage', "\"ErrorCode\" = '404'")) { + $errorPage = DataObject::get_one('ErrorPage', "\"ErrorCode\" = '404'"); + if(!($errorPage && $errorPage->exists())) { $errorpage = new ErrorPage(); $errorpage->ErrorCode = 404; $errorpage->Title = _t('ErrorPage.DEFAULTERRORPAGETITLE', 'Page not found');
BUGFIX Ensure that before creating default <I> error page, we don't have one already that exists with a record ID (from r<I>) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
silverstripe_silverstripe-framework
train
php
28e9c6ce4967af30fc6d36e95b743e973f5c2b72
diff --git a/lib/partition.js b/lib/partition.js index <HASH>..<HASH> 100644 --- a/lib/partition.js +++ b/lib/partition.js @@ -23,8 +23,8 @@ Partition.prototype = { constructor: Partition, __OOB: function( lba ) { - return lba <= this.firstLBA || - lba >= this.lastLBA + return lba < this.firstLBA || + lba > this.lastLBA }, get blockSize() {
Updated lib/partition: Fixed error in .__OOB() Less/more than or equal should've just been less/more than. No equal. NO EQUAL.
jhermsmeier_node-blockdevice
train
js
e23421b1b7f50f14b9b364df9d7638060d1effd2
diff --git a/src/Helpers/MenuBuilder.php b/src/Helpers/MenuBuilder.php index <HASH>..<HASH> 100644 --- a/src/Helpers/MenuBuilder.php +++ b/src/Helpers/MenuBuilder.php @@ -133,7 +133,7 @@ class MenuBuilder $path = ltrim(rtrim($item['path'], '/'), '/'); // Pre-set our link in case the match() throws an exception - $item['link'] = '/' . $path; + $item['link'] = $this->app['resources']->getUrl('root') . $path; try { // See if we have a 'content/id' or 'content/slug' path
Don't assume root URL is '/'
bolt_bolt
train
php
b4600d012decc88568893d58e6dbd4296472dfe5
diff --git a/vocabs/fpad/index.js b/vocabs/fpad/index.js index <HASH>..<HASH> 100644 --- a/vocabs/fpad/index.js +++ b/vocabs/fpad/index.js @@ -528,7 +528,7 @@ register('corrective_action', { description: 'corrective_action is the corrective action details associated with '+ 'a particular control point as found in the corrective actions report.', propertySchema: enumSchema([ - 'score', 'organization_response', 'organization_comments', 'decision' + 'score', 'organization_response', 'organization_comments', 'decision', 'files', ]), });
corrective actions should have their own files array
OADA_oada-formats
train
js
4b72e880e5945d4300ed527db040676842cf8793
diff --git a/jspdf.js b/jspdf.js index <HASH>..<HASH> 100644 --- a/jspdf.js +++ b/jspdf.js @@ -933,14 +933,17 @@ PubSub implementation @name output */ output = function (type, options) { - var undef, isThisSafari, data, length, array, i, blob; + var undef, data, length, array, i, blob; switch (type) { case undef: return buildDocument(); case 'save': - isThisSafari = navigator.vendor !== undefined ? navigator.vendor.split(' ')[0] : 'must be ie'; - if (window.opera !== undefined || isThisSafari === 'Apple') { - return API.output('dataurlnewwindow'); + if (navigator.getUserMedia || Blob.prototype.slice === undefined) { + if (window.URL === undefined) { + return API.output('dataurlnewwindow'); + } else if (window.URL.createObjectURL === undefined) { + return API.output('dataurlnewwindow'); + } } data = buildDocument();
jspdf.js : No more asking about Safari or Opera
MrRio_jsPDF
train
js
c40daa04a3076591a4c69bf62152eb767125b217
diff --git a/webapps/ui/cockpit/plugins/base/app/views/processInstance/incidentsTab.js b/webapps/ui/cockpit/plugins/base/app/views/processInstance/incidentsTab.js index <HASH>..<HASH> 100644 --- a/webapps/ui/cockpit/plugins/base/app/views/processInstance/incidentsTab.js +++ b/webapps/ui/cockpit/plugins/base/app/views/processInstance/incidentsTab.js @@ -4,7 +4,6 @@ var fs = require('fs'); var angular = require('angular'); var incidentsTemplate = fs.readFileSync(__dirname + '/incidents-tab.html', 'utf8'); -var retryTemplate = fs.readFileSync(__dirname + '/job-retry-dialog.html', 'utf8'); var Configuration = function PluginConfiguration(ViewsProvider) { ViewsProvider.registerDefaultView('cockpit.processInstance.runtime.tab', {
fix(incident tab): remove unused template Related to: #CAM-<I>
camunda_camunda-bpm-platform
train
js
0b986bd0444725610e87f17e9c5dc2fde8cbdeb3
diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index <HASH>..<HASH> 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -688,6 +688,12 @@ func generateCfgFromFlags(cmd *cobra.Command, k8sVersion string) (cfg.Config, er // convert https_proxy to HTTPS_PROXY for linux // TODO (@medyagh): if user has both http_proxy & HTTPS_PROXY set merge them. k = strings.ToUpper(k) + if k == "HTTP_PROXY" || k == "HTTPS_PROXY" { + if strings.HasPrefix(v, "localhost") || strings.HasPrefix(v, "127.0") { + out.WarningT("Not passing {{.name}}={{.value}} to docker env.", out.V{"name": k, "value": v}) + continue + } + } dockerEnv = append(dockerEnv, fmt.Sprintf("%s=%s", k, v)) } }
don't pass http_proxy to dockerEnv if it's poiting to localhost
kubernetes_minikube
train
go
fe82b0dcaf9fa3e750b5ffcadc1cf5089d3fa536
diff --git a/lib/reqres_rspec/version.rb b/lib/reqres_rspec/version.rb index <HASH>..<HASH> 100644 --- a/lib/reqres_rspec/version.rb +++ b/lib/reqres_rspec/version.rb @@ -1,3 +1,3 @@ module ReqresRspec - VERSION = '0.0.21' + VERSION = '0.0.22' end
upd version to <I>
reqres-api_reqres_rspec
train
rb
b1c10710be302364b2b7e45a1a0d75b83814d5d6
diff --git a/app/models/renalware/ukrdc/incoming/file_list.rb b/app/models/renalware/ukrdc/incoming/file_list.rb index <HASH>..<HASH> 100644 --- a/app/models/renalware/ukrdc/incoming/file_list.rb +++ b/app/models/renalware/ukrdc/incoming/file_list.rb @@ -6,7 +6,7 @@ module Renalware module UKRDC module Incoming class FileList - pattr_initialize [pattern: "*.xml", paths: Paths.new] + pattr_initialize [pattern: "survey*.xml", paths: Paths.new] # Helper which yields each file in the incoming folder. def each_file
Only import UKRDC xml files starting with 'survey'
airslie_renalware-core
train
rb
d57f45db7cdc30556c5d62aca8bcc90dd6086bb1
diff --git a/src/main/java/org/hibernate/cache/infinispan/util/Caches.java b/src/main/java/org/hibernate/cache/infinispan/util/Caches.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/hibernate/cache/infinispan/util/Caches.java +++ b/src/main/java/org/hibernate/cache/infinispan/util/Caches.java @@ -319,6 +319,11 @@ public class Caches { public Object next() { return entryIterator.next().getKey(); } + + @Override + public void remove() { + throw new UnsupportedOperationException( "remove() not supported" ); + } }; }
HHH-<I> - Fix problem with incomplete Iterator impl
infinispan_infinispan
train
java
03f40c2ae0dca564fcf67995aa05d61b8335fb37
diff --git a/state/api/serve.go b/state/api/serve.go index <HASH>..<HASH> 100644 --- a/state/api/serve.go +++ b/state/api/serve.go @@ -65,7 +65,6 @@ func (srv *Server) run(lis net.Listener) { srv.wg.Done() }() handler := websocket.Handler(func(conn *websocket.Conn) { - defer conn.Close() srv.wg.Add(1) defer srv.wg.Done() // If we've got to this stage and the tomb is still @@ -102,6 +101,12 @@ type rpcResponse struct { func (st *srvState) run() { msgs := make(chan rpcRequest) go st.readRequests(msgs) + defer func() { + st.conn.Close() + // Wait for readRequests to see the closed connection and quit. + for _ = range msgs { + } + }() for { var req rpcRequest var ok bool
state/api: wait for readRequsts to quit
juju_juju
train
go
3d3fec83884a643cf2a848556aba036e13d5ed74
diff --git a/src/main/lombok/ast/ListAccessor.java b/src/main/lombok/ast/ListAccessor.java index <HASH>..<HASH> 100644 --- a/src/main/lombok/ast/ListAccessor.java +++ b/src/main/lombok/ast/ListAccessor.java @@ -277,7 +277,7 @@ class ListAccessor<T extends Node, P extends Node> { } @Override public T get(int idx) { - Node r = raw.first(); + Node r = raw.get(idx); if (r == null) throw new IndexOutOfBoundsException(); if (!tClass.isInstance(r)) throw new AstException(parent, String.format( "element #%d of %s isn't of the appropriate type(%s): %s",
Bugfix: StrictListAccessor's get method was broken and always returned entry 0.
rzwitserloot_lombok.ast
train
java
baa742c1abf51e7c3888ff4544e885041e3b7412
diff --git a/client/my-sites/stats/annual-site-stats/index.js b/client/my-sites/stats/annual-site-stats/index.js index <HASH>..<HASH> 100644 --- a/client/my-sites/stats/annual-site-stats/index.js +++ b/client/my-sites/stats/annual-site-stats/index.js @@ -188,7 +188,7 @@ class AnnualSiteStats extends Component { { isWidget && currentYearData && this.renderWidgetContent( currentYearData, strings ) } { isWidget && previousYearData && this.renderWidgetContent( previousYearData, strings ) } { ! isWidget && years && this.renderTable( years, strings ) } - { isWidget && years && years.length && ( + { isWidget && years && years.length !== 0 && ( <div className="module-expand"> <a href={ viewAllLink }> { translate( 'View All', { context: 'Stats: Button label to expand a panel' } ) }
Fix for errant "0" character when viewing a site with no annual stats. (#<I>)
Automattic_wp-calypso
train
js
4be7a0b21219694c0e865fee3443a57f363ac51d
diff --git a/src/components/SingleValue.js b/src/components/SingleValue.js index <HASH>..<HASH> 100644 --- a/src/components/SingleValue.js +++ b/src/components/SingleValue.js @@ -23,7 +23,7 @@ export const css = ({ isDisabled }: State) => ({ color: isDisabled ? colors.neutral40 : colors.text, marginLeft: spacing.baseUnit / 2, marginRight: spacing.baseUnit / 2, - maxWidth: '100%', + maxWidth: `calc(100% - ${spacing.baseUnit * 2}px)`, overflow: 'hidden', position: 'absolute', textOverflow: 'ellipsis', diff --git a/src/components/containers.js b/src/components/containers.js index <HASH>..<HASH> 100644 --- a/src/components/containers.js +++ b/src/components/containers.js @@ -64,6 +64,7 @@ export const valueContainerCSS = ({ maxHeight }: ValueContainerProps) => ({ overflowY: 'auto', padding: `${spacing.baseUnit / 2}px ${spacing.baseUnit * 2}px`, WebkitOverflowScrolling: 'touch', + position: 'relative', }); export class ValueContainer extends Component<ValueContainerProps> { shouldScrollBottom: boolean = false;
fix for overflowing long values in SingleValue and ValueContainer
JedWatson_react-select
train
js,js
54b0f8b224c2efaea8844ba684290d279893b1fb
diff --git a/package-scripts.js b/package-scripts.js index <HASH>..<HASH> 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -1,8 +1,8 @@ -/* eslint prefer-template:"off" */ // this file runs in node 0.10.0 -const nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]) -const validate = ['lint', 'build', 'cover'] +/* eslint prefer-template:"off", no-var:"off" */ // this file runs in node 0.10.0 +var nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]) +var validate = ['lint', 'build', 'cover'] if (nodeVersion < 4) { - validate.slice(1) + validate = validate.slice(1) } module.exports = { scripts: {
fix(scripts): validate needs reassignment
kentcdodds_nps
train
js
212046e1c439a7f0c660999b9fbabe7e7a93294a
diff --git a/lib/active_scaffold/actions/core.rb b/lib/active_scaffold/actions/core.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/actions/core.rb +++ b/lib/active_scaffold/actions/core.rb @@ -2,6 +2,7 @@ module ActiveScaffold::Actions module Core def self.included(base) base.class_eval do + before_action :set_vary_accept_header before_action :handle_user_settings before_action :check_input_device before_action :register_constraints_with_action_columns, :unless => :nested? @@ -292,6 +293,10 @@ module ActiveScaffold::Actions session.delete(session_index) if session[session_index].blank? end + def set_vary_accept_header + response.headers['Vary'] = 'Accept' + end + # at some point we need to pass the session and params into config. we'll just take care of that before any particular action occurs by passing those hashes off to the UserSettings class of each action. def handle_user_settings storage = active_scaffold_config.store_user_settings ? active_scaffold_session_storage : {}
avoid browser mixes html and xhr cache for listing requests, using vary header
activescaffold_active_scaffold
train
rb
0c662bb33dfb49236ca4c68b81d426d8948da224
diff --git a/config/__init__.py b/config/__init__.py index <HASH>..<HASH> 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -12,7 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os from .config_exception import ConfigException from .incluster_config import load_incluster_config from .kube_config import (list_kube_config_contexts, load_kube_config, - load_kube_config_from_dict, new_client_from_config) + load_kube_config_from_dict, new_client_from_config, KUBE_CONFIG_DEFAULT_LOCATION) + + +def load_config(**kwargs): + """ + Wrapper function to load the kube_config. + It will initially try to load_kube_config from provided path, then check if the KUBE_CONFIG_DEFAULT_LOCATION exists + If neither exists- it will fall back to load_incluster_config and inform the user accordingly. + """ + if "kube_config_path" in kwargs.keys() or os.path.exists(KUBE_CONFIG_DEFAULT_LOCATION): + load_kube_config(**kwargs) + else: + print(f"kube_config_path not provided and default location ({KUBE_CONFIG_DEFAULT_LOCATION}) does not exist. " + "Using inCluster Config. This might not work.") + load_incluster_config(**kwargs)
Adding load_config wrapper method to have a more generic way of initializing the client config
kubernetes-client_python
train
py
ec6dfe9a8dd8c7341247312b31e5b698817a80cb
diff --git a/src/Console/UseCommand.php b/src/Console/UseCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/UseCommand.php +++ b/src/Console/UseCommand.php @@ -11,11 +11,13 @@ class UseCommand extends Command private $elixirFiles = [ 'gulpfile.js', 'package.json', + 'package-lock.json', 'tasks/bin.js', ]; private $mixFiles = [ 'webpack.mix.js', 'package.json', + 'package-lock.json', 'tasks/bin.js', ];
Remove package-lock.json when switching build tools
tightenco_jigsaw
train
php
fa41a321183cd69653ec02e8963e72817bed9ba8
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,7 @@ function getTarget (abi, runtime) { .map(function (t) { return t.target }) - if (match) return match[0] + if (match.length) return match[0] throw new Error('Could not detect target for abi ' + abi + ' and runtime ' + runtime) } diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -15,6 +15,7 @@ test('getTarget calculates correct Node target', function (t) { }) test('getTarget calculates correct Electron target', function (t) { + t.throws(getTarget.bind(null, '14', 'electron')) t.equal(getTarget('47', 'electron'), '1.0.2') t.equal(getTarget('48', 'electron'), '1.2.8') t.equal(getTarget('49', 'electron'), '1.3.13')
fix case where there is no electron match
lgeiger_node-abi
train
js,js
463ac282e035a029f6bb90be8a44091042158264
diff --git a/examples/ROOT/inspect_tree.py b/examples/ROOT/inspect_tree.py index <HASH>..<HASH> 100755 --- a/examples/ROOT/inspect_tree.py +++ b/examples/ROOT/inspect_tree.py @@ -42,7 +42,7 @@ for leaf in tree.GetListOfLeaves(): row = [ ] row.append(leaf.GetName()) row.append(leaf.GetTypeName()) - row.append(typedic[leaf.GetTypeName()]) + row.append(typedic[leaf.GetTypeName()] if leaf.GetTypeName() in typedic else "unknown") row.append('yes ' if isArray else 'no') row.append(leafcount.GetName() if isArray else None) row.append(leafcount.GetTypeName() if isArray else None)
update examples/ROOT/inspect_tree.py
alphatwirl_alphatwirl
train
py
76630bd02e7f3d5cc1f12d56b12e0f35b9beca56
diff --git a/lib/walker.js b/lib/walker.js index <HASH>..<HASH> 100644 --- a/lib/walker.js +++ b/lib/walker.js @@ -857,7 +857,6 @@ this.atomize = atomize; this.ignore.push(atomize); } - this.ignore.push('this'); } ProxyInjector.prototype = {
It is not correct to always ignore 'this' in a txn - the txn function could have been bound to non-global 'this' and thus 'this' can be useful.
atomizejs_atomize-client
train
js
5c80a623233db0412ff1994b4f0535163a974f26
diff --git a/lib/plugins/tar.js b/lib/plugins/tar.js index <HASH>..<HASH> 100644 --- a/lib/plugins/tar.js +++ b/lib/plugins/tar.js @@ -76,7 +76,11 @@ Tar.prototype.finalize = function() { }; Tar.prototype.on = function() { - return this.engine.on.apply(this.engine, arguments); + if (this.compressor) { + return this.compressor.on.apply(this.compressor, arguments); + } else { + return this.engine.on.apply(this.engine, arguments); + } }; Tar.prototype.pipe = function(destination, options) {
tar: when using compressor, make sure event listener gets hooked to the proper stream.
archiverjs_node-archiver
train
js
ede0ab8d80a5d77429687a03fb2c61078306a053
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -246,7 +246,7 @@ class CrawlKit { let timeoutHandler; const runnerId = next.value[0]; const runner = next.value[1]; - Promise.all([runner.getCompanionFiles() || []].map((filename) => { + Promise.all((runner.getCompanionFiles() || []).map((filename) => { return new Promise((injected, reject) => { scope.page.injectJs(filename, (err) => { if (err) {
fix: companionfiles was always an empty array
crawlkit_crawlkit
train
js
014ba4d6eee173db25c8a541ccd888fa8b44ce16
diff --git a/loader/src/main/java/lucee/loader/engine/CFMLEngineFactory.java b/loader/src/main/java/lucee/loader/engine/CFMLEngineFactory.java index <HASH>..<HASH> 100755 --- a/loader/src/main/java/lucee/loader/engine/CFMLEngineFactory.java +++ b/loader/src/main/java/lucee/loader/engine/CFMLEngineFactory.java @@ -683,7 +683,7 @@ public class CFMLEngineFactory extends CFMLEngineFactorySupport { String sub="bundles/"; String nameAndVersion=symbolicName+"|"+symbolicVersion; String osgiFileName=symbolicName+"-"+symbolicVersion+".jar"; - String pack20Ext=".jar.pack.gz"; + String pack20Ext=".pack.gz"; boolean isPack200=false; // first we look for a exact match
improve performance for looking for bundled bundles
lucee_Lucee
train
java
83f54ae42083d6cbbfbc7928fdbb9ac73fbf41a5
diff --git a/src/Exscript/protocols/SSH2.py b/src/Exscript/protocols/SSH2.py index <HASH>..<HASH> 100644 --- a/src/Exscript/protocols/SSH2.py +++ b/src/Exscript/protocols/SSH2.py @@ -306,7 +306,7 @@ class SSH2(Protocol): data = self.shell.recv(200) if not data: return False - self._receive_cb(data) + self._receive_cb(data, False) self.buffer.append(data) return True
exscript: Fixed bug: Removed newlines in buffer and printed out without.
knipknap_exscript
train
py
5c3c4adbcdce9fc7aafcbde4ff7a6f54784880aa
diff --git a/src/deep-resource/lib/Resource/Exception/SourceNotAvailableException.js b/src/deep-resource/lib/Resource/Exception/SourceNotAvailableException.js index <HASH>..<HASH> 100644 --- a/src/deep-resource/lib/Resource/Exception/SourceNotAvailableException.js +++ b/src/deep-resource/lib/Resource/Exception/SourceNotAvailableException.js @@ -12,6 +12,6 @@ export class SourceNotAvailableException extends Exception { * @param {Action|*} action */ constructor(type, action) { - super(`The ${type} source is not available for ${action.fullName}`); + super(`The ${type} source is not available for the resource '${action.fullName}'`); } }
Fix validation bootstrap and implement request source validation
MitocGroup_deep-framework
train
js
e1a778a4c1986eceb957417c2c2278624402ea77
diff --git a/UrlLinker.php b/UrlLinker.php index <HASH>..<HASH> 100644 --- a/UrlLinker.php +++ b/UrlLinker.php @@ -14,7 +14,7 @@ * Regular expression bits used by htmlEscapeAndLinkUrls() to match URLs. */ $rexProtocol = '(https?://)?'; -$rexDomain = '(?:[-a-zA-Z0-9]{1,63}\.)+[-a-zA-Z0-9]{2,63}'; +$rexDomain = '(?:[-a-zA-Z0-9]{1,63}\.)+[a-zA-Z][-a-zA-Z0-9]{1,62}'; $rexIp = '(?:[0-9]{1,3}\.){3}[0-9]{1,3}'; $rexPort = '(:[0-9]{1,5})?'; $rexPath = '(/[!$-/0-9:;=@_\':;!a-zA-Z\x7f-\xff]*?)?';
UrlLinker: : Don't match TLDs that start with a digit.
youthweb_urllinker
train
php
9c0391d5e9486bf57d4ee0383fb6459571a9605b
diff --git a/lib/jsonapi/active_relation_resource_finder/join_tree.rb b/lib/jsonapi/active_relation_resource_finder/join_tree.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/active_relation_resource_finder/join_tree.rb +++ b/lib/jsonapi/active_relation_resource_finder/join_tree.rb @@ -83,7 +83,12 @@ module JSONAPI segment.relationship.resource_types.each do |related_resource_type| related_resource_klass = resource_klass.resource_klass_for(related_resource_type) - if !segment.path_specified_resource_klass? || related_resource_klass == segment.resource_klass + + # If the resource type was specified in the path segment we want to only process the next segments for + # that resource type, otherwise process for all + process_all_types = !segment.path_specified_resource_klass? + + if process_all_types || related_resource_klass == segment.resource_klass related_resource_tree = process_path_to_tree(path_segments.dup, related_resource_klass, default_join_type, default_polymorphic_join_type) node[:resource_klasses][resource_klass][:relationships][segment.relationship].deep_merge!(related_resource_tree) end
Clarify logic for processing polymorphic path segments with resource type
cerebris_jsonapi-resources
train
rb
339e01e20a0a54cc09ff5e35a5a3bbb36002d258
diff --git a/LiSE/LiSE/thing.py b/LiSE/LiSE/thing.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/thing.py +++ b/LiSE/LiSE/thing.py @@ -56,12 +56,9 @@ class Thing(Node): return self.name def _getloc(self): - ret = self.engine._things_cache._base_retrieve( - (self.character.name, self.name, *self.engine._btt()) + return self.engine._things_cache.retrieve( + self.character.name, self.name, *self.engine._btt() ) - if isinstance(ret, Exception): - return None - return ret def _validate_node_type(self): try:
Handle errors in Thing._getloc By letting ThingsCache.retrieve do it.
LogicalDash_LiSE
train
py
662e4541a0066de4151b9f95111e9e162cca7ce6
diff --git a/openquake/engine/calculators/hazard/general.py b/openquake/engine/calculators/hazard/general.py index <HASH>..<HASH> 100644 --- a/openquake/engine/calculators/hazard/general.py +++ b/openquake/engine/calculators/hazard/general.py @@ -220,12 +220,16 @@ class BaseHazardCalculator(base.Calculator): trt_model.save() task_no = 0 + tot_sources = 0 for trt_model, block in all_sources.split(self.concurrent_tasks): args = (self.job.id, sitecol, block, trt_model.id, task_no) self._task_args.append(args) yield args task_no += 1 + tot_sources += len(block) + logs.LOG.info('Filtered %d sources for %d TRTs', + tot_sources, len(self.source_collector)) def task_completed(self, result): """
Logged the total number of sources Former-commit-id: <I>a2cf<I>b<I>f<I>f7c<I>d<I>a<I>a9f<I>
gem_oq-engine
train
py
d0ab10917d8414419c69c91e3843080d8d4ca44a
diff --git a/mockserver-netty/src/main/java/org/mockserver/dashboard/DashboardWebSocketHandler.java b/mockserver-netty/src/main/java/org/mockserver/dashboard/DashboardWebSocketHandler.java index <HASH>..<HASH> 100644 --- a/mockserver-netty/src/main/java/org/mockserver/dashboard/DashboardWebSocketHandler.java +++ b/mockserver-netty/src/main/java/org/mockserver/dashboard/DashboardWebSocketHandler.java @@ -354,7 +354,7 @@ public class DashboardWebSocketHandler extends ChannelInboundHandlerAdapter impl Description description = activeExpectationsDescriptionProcessor.description(requestMatcher.getExpectation().getHttpRequest(), requestMatcher.getExpectation().getId()); return ImmutableMap.of( "key", requestMatcher.getExpectation().getId(), - "description", description != null ? description : "", + "description", description != null ? description : requestMatcher.getExpectation().getId(), "value", expectationJsonNode ); })
further improved dashboard processing of log when no request is present on the expectation
jamesdbloom_mockserver
train
java
39bc023caf29ea555339e1f41f4328f14c9b04a9
diff --git a/libnetwork/drivers/overlay/ov_network.go b/libnetwork/drivers/overlay/ov_network.go index <HASH>..<HASH> 100644 --- a/libnetwork/drivers/overlay/ov_network.go +++ b/libnetwork/drivers/overlay/ov_network.go @@ -403,9 +403,10 @@ func (n *network) watchMiss(nlSock *nl.NetlinkSocket) { continue } - if neigh.IP.To16() != nil { + if neigh.IP.To4() == nil { continue } + logrus.Debugf("miss notification for dest IP, %v", neigh.IP.String()) if neigh.State&(netlink.NUD_STALE|netlink.NUD_INCOMPLETE) == 0 { continue
Correct the check in l3 miss handling in overlay driver
moby_moby
train
go
c1949cf2d26acc13864db3b6667f743f8f1ce09e
diff --git a/docs/tag-defs/index.js b/docs/tag-defs/index.js index <HASH>..<HASH> 100644 --- a/docs/tag-defs/index.js +++ b/docs/tag-defs/index.js @@ -1,14 +1,8 @@ module.exports = [ { - name: 'order', - defaultFn: function(doc) { - return doc.name; - } + name: 'order' }, { - name: 'paramType', - defaultFn: function(doc) { - return doc.name.charAt(0).toUpperCase() + doc.name.substring(1); - } + name: 'paramType' } ];
docs(): make paramType not accidentally be marked
angular_material
train
js
3243bcce37dd0751ae42834f6a92dd354e391bb8
diff --git a/passpie/crypt.py b/passpie/crypt.py index <HASH>..<HASH> 100644 --- a/passpie/crypt.py +++ b/passpie/crypt.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import errno import os import shutil diff --git a/tests/test_crypt.py b/tests/test_crypt.py index <HASH>..<HASH> 100644 --- a/tests/test_crypt.py +++ b/tests/test_crypt.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import os from passpie.crypt import Cryptor, KEY_INPUT @@ -131,3 +132,8 @@ class CryptTests(MockerTestCase): with self.assertRaises(ValueError): cryptor.check(passphrase, ensure=True) + + def test_key_input_format_with_unicode_characters(self): + unicode_string = 'áçéèúü' + + self.assertIsNotNone(KEY_INPUT.format(unicode_string))
Fix unicode character on passphrases when generating keys. Fixes #<I>
marcwebbie_passpie
train
py,py
f1d2c4fbbe9124a3c2d7dcc20250f836c114af30
diff --git a/plugins/CoreVue/Commands/Build.php b/plugins/CoreVue/Commands/Build.php index <HASH>..<HASH> 100644 --- a/plugins/CoreVue/Commands/Build.php +++ b/plugins/CoreVue/Commands/Build.php @@ -153,6 +153,9 @@ class Build extends ConsoleCommand if ($this->isTypeScriptRaceConditionInOutput($plugin, $concattedOutput)) { $output->writeln("<comment>The TypeScript compiler encountered a race condition when compiling " . "files (files that exist were not found), retrying.</comment>"); + + ++$attempts; + continue; } if ($returnCode != 0 @@ -163,7 +166,7 @@ class Build extends ConsoleCommand $output->writeln(""); } - ++$attempts; + break; } }
fix retry loop in vue:build command (#<I>)
matomo-org_matomo
train
php
9bb9d446b5b89fc93e1681c59ceaee997f135c51
diff --git a/cli/src/main/java/hudson/cli/FullDuplexHttpStream.java b/cli/src/main/java/hudson/cli/FullDuplexHttpStream.java index <HASH>..<HASH> 100644 --- a/cli/src/main/java/hudson/cli/FullDuplexHttpStream.java +++ b/cli/src/main/java/hudson/cli/FullDuplexHttpStream.java @@ -115,8 +115,9 @@ public class FullDuplexHttpStream { private void getData() { try { String base = createCrumbUrlBase(); - crumbName = readData(base+"?xpath=/*/crumbRequestField/text()"); - crumb = readData(base+"?xpath=/*/crumb/text()"); + String[] pair = readData(base + "?xpath=concat(//crumbRequestField,\":\",//crumb)").split(":", 2); + crumbName = pair[0]; + crumb = pair[1]; isValid = true; LOGGER.fine("Crumb data: "+crumbName+"="+crumb); } catch (IOException e) {
More efficient to contact crumbIssuer just once and get both name and value.
jenkinsci_jenkins
train
java
b597588c6a3227867790871012a123d89526236c
diff --git a/src/GDS/Gateway/GoogleAPIClient.php b/src/GDS/Gateway/GoogleAPIClient.php index <HASH>..<HASH> 100644 --- a/src/GDS/Gateway/GoogleAPIClient.php +++ b/src/GDS/Gateway/GoogleAPIClient.php @@ -76,6 +76,24 @@ class GoogleAPIClient extends \GDS\Gateway } /** + * Create a configured Google Client ready for Datastore use, using the JSON service file from Google Dev Console + * + * @param $str_json_file + * @return \Google_Client + */ + public static function createClientFromJson($str_json_file) + { + $obj_client = new \Google_Client(); + $obj_client->setAssertionCredentials($obj_client->loadServiceAccountJson( + $str_json_file, + [\Google_Service_Datastore::DATASTORE, \Google_Service_Datastore::USERINFO_EMAIL] + )); + // App Engine php55 runtime dev server problems... + $obj_client->setClassConfig('Google_Http_Request', 'disable_gzip', TRUE); + return $obj_client; + } + + /** * Put an array of Entities into the Datastore. Return any that need AutoIDs * * @todo Validate support for per-entity Schemas
Method for creating Google_Client objects from the dev console JSON config files
tomwalder_php-gds
train
php
cf19c176f67260996245089a0d555c3d32ab18c9
diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java @@ -293,7 +293,7 @@ class WebMvcAutoConfigurationTests { this.contextRunner.run((context) -> { assertThat(context).hasSingleBean(LocaleResolver.class); LocaleResolver localeResolver = context.getBean(LocaleResolver.class); - assertThat(((AcceptHeaderLocaleResolver) localeResolver).getDefaultLocale()).isNull(); + assertThat(localeResolver).hasFieldOrPropertyWithValue("defaultLocale", null); }); }
Adapt test to change in Spring Framework snapshots
spring-projects_spring-boot
train
java
47a36d75d9840b571fca2008647f8c21deb213f1
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,7 @@ try: except ImportError: on_rtd = True numpy = None + build_ext = None import os
trying to make rtd-working
timothydmorton_VESPA
train
py
a0010f5cd41e32e30bc3a903d04fd5a841597480
diff --git a/lib/plugins/muc.js b/lib/plugins/muc.js index <HASH>..<HASH> 100644 --- a/lib/plugins/muc.js +++ b/lib/plugins/muc.js @@ -16,7 +16,8 @@ module.exports = function (client) { room: msg.from, reason: msg.muc.invite.reason, password: msg.muc.password, - thread: msg.muc.invite.thread + thread: msg.muc.invite.thread, + type: 'mediated' }); } if (msg._extensions.muc._extensions.destroyed) { @@ -40,7 +41,8 @@ module.exports = function (client) { room: msg.mucInvite.jid, reason: msg.mucInvite.reason, password: msg.mucInvite.password, - thread: msg.mucInvite.thread + thread: msg.mucInvite.thread, + type: 'direct' }); }
Add invite type to MUC invite events
legastero_stanza.io
train
js
70a4a5654f32ee4bec09c603624da3c0279fb92e
diff --git a/lib/remi/job.rb b/lib/remi/job.rb index <HASH>..<HASH> 100644 --- a/lib/remi/job.rb +++ b/lib/remi/job.rb @@ -13,7 +13,7 @@ module Remi def define_source(name, type_class, **options) @sources ||= [] - @sources << name + @sources << name unless @sources.include? name define_method(name) do iv_name = instance_variable_get("@#{name}") @@ -26,7 +26,7 @@ module Remi def define_target(name, type_class, **options) @targets ||= [] - @targets << name + @targets << name unless @targets.include? name define_method(name) do iv_name = instance_variable_get("@#{name}")
FIX - Prevents the list of sources and targets for a job from duplicating This would happen when the class file is loaded multiple times in a session.
inside-track_remi
train
rb
49ff649fe907543028d737b95b0e5f5ed767a071
diff --git a/canmatrix/importsym.py b/canmatrix/importsym.py index <HASH>..<HASH> 100644 --- a/canmatrix/importsym.py +++ b/canmatrix/importsym.py @@ -129,10 +129,16 @@ def importSym(filename, **options): line = line.replace(' ', ' "" ') tempArray = shlex.split(line.strip()) sigName = tempArray[0] - if indexOffset == 1 and tempArray[1][:8] == "unsigned": - is_signed = False - else: + + if indexOffset != 1: is_signed = True + else: + if tempArray[1] == 'unsigned': + is_signed = False + elif tempArray[1] == 'signed': + is_signed = True + else: + raise ValueError('Unknown type \'{}\' found'.format(tempArray[1])) startBit = int(tempArray[indexOffset+1].split(',')[0]) signalLength = int(tempArray[indexOffset+1].split(',')[1])
Error out on unknown variable type
ebroecker_canmatrix
train
py
e73a09f30530c06b26ee88d802e012e03aafbada
diff --git a/mock_django/query.py b/mock_django/query.py index <HASH>..<HASH> 100644 --- a/mock_django/query.py +++ b/mock_django/query.py @@ -76,6 +76,7 @@ def QuerySetMock(model, *return_value): m.__getitem__.side_effect = make_getitem(m) m.model = model m.get = make_get(m, actual_model) + m.exists.return_value = bool(return_value) # Note since this is a SharedMock, *all* auto-generated child # attributes will have the same side_effect ... might not make
Simple hack for making exists work as expected
dcramer_mock-django
train
py
5f1b30e6e9dd8f1aea11c8c6fddc565a74dbcb2c
diff --git a/bugsy/bug.py b/bugsy/bug.py index <HASH>..<HASH> 100644 --- a/bugsy/bug.py +++ b/bugsy/bug.py @@ -189,7 +189,7 @@ class Bug(object): if key not in self._copy or self._bug[key] != self._copy[key]: changed[key] = self._bug[key] elif key == 'flags': - if sorted(self._bug.get(key, [])) != sorted(self._copy.get(key, [])): + if self._bug.get(key, []) != self._copy.get(key, []): changed[key] = self._bug.get(key, []) else: values_now = set(self._bug.get(key, []))
Raw compare as flag order shouldn't change
AutomatedTester_Bugsy
train
py
3716fc567d3b54d08f02c4935f4aa99e1e816299
diff --git a/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java b/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java index <HASH>..<HASH> 100644 --- a/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java +++ b/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java @@ -177,6 +177,9 @@ public class SelfRegisteringRemote { LOG.fine("Using the json request : " + registrationRequest.toJson()); Boolean register = registrationRequest.getConfiguration().register; + if (register == null) { + register = false; + } if (!register) { LOG.info("No registration sent ( register = false )");
handle when register is null, don't throw NPE, default to false Fixes #<I>
SeleniumHQ_selenium
train
java
7a0fbd0eb14f865753c5918fe73ecc4d24cfe503
diff --git a/public/js/gogs.js b/public/js/gogs.js index <HASH>..<HASH> 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -719,7 +719,7 @@ function initEditor() { var val = $editFilename.val(), m, mode, spec, extension, extWithDot, previewLink, dataUrl, apiCall; extension = extWithDot = ""; if (m = /.+\.([^.]+)$/.exec(val)) { - extension = m[1]; + extension = m[1].toLowerCase(); extWithDot = "." + extension; }
public: makes CodeMirror mode by filename lookups case-insensitive (#<I>) * updated the highlight.js plugin * added some explicit mappings for syntax highlighting * public: makes CodeMirror mode by filename extension lookup case-insensitive
gogs_gogs
train
js
8be3b585fdbbf34fd9cedc003114f1db74bcc9a5
diff --git a/interp/interp_test.go b/interp/interp_test.go index <HASH>..<HASH> 100644 --- a/interp/interp_test.go +++ b/interp/interp_test.go @@ -893,6 +893,9 @@ var fileCases = []struct { "char\n", }, {"[[ -t 1234 ]]", "exit status 1"}, // TODO: reliable way to test a positive? + {"[[ -o wrong ]]", "exit status 1"}, + {"[[ -o errexit ]]", "exit status 1"}, + {"set -e; [[ -o errexit ]]", ""}, // classic test { diff --git a/interp/test.go b/interp/test.go index <HASH>..<HASH> 100644 --- a/interp/test.go +++ b/interp/test.go @@ -161,7 +161,13 @@ func (r *Runner) unTest(op syntax.UnTestOperator, x string) bool { return x == "" case syntax.TsNempStr: return x != "" - //case syntax.TsOptSet: + case syntax.TsOptSet: + switch x { + case "errexit": + return r.stopOnCmdErr + default: + return false + } case syntax.TsVarSet: _, e := r.lookupVar(x) return e
interp: implement test's -o For the options we currently support, at least.
mvdan_sh
train
go,go
84179da6b6e300bbea2fbad9d9bb3560cfda1292
diff --git a/cluster/kubernetes/resourcekinds.go b/cluster/kubernetes/resourcekinds.go index <HASH>..<HASH> 100644 --- a/cluster/kubernetes/resourcekinds.go +++ b/cluster/kubernetes/resourcekinds.go @@ -66,6 +66,15 @@ func (pc podController) toClusterController(resourceID flux.ResourceID) cluster. } clusterContainers = append(clusterContainers, resource.Container{Name: container.Name, Image: ref}) } + for _, container := range pc.podTemplate.Spec.Containers { + ref, err := image.ParseRef(container.Image) + if err != nil { + clusterContainers = nil + excuse = err.Error() + break + } + clusterContainers = append(clusterContainers, resource.Container{Name: container.Name, Image: ref}) + } var antecedent flux.ResourceID if ante, ok := pc.GetAnnotations()[AntecedentAnnotation]; ok {
Include initContainers in containers considered
weaveworks_flux
train
go
41d81b5c9ee6e97f8544874d03a3fd70447f32b9
diff --git a/src/Content/CTextFilter.php b/src/Content/CTextFilter.php index <HASH>..<HASH> 100644 --- a/src/Content/CTextFilter.php +++ b/src/Content/CTextFilter.php @@ -158,19 +158,19 @@ class CTextFilter switch ($matches[1]) { case 'FIGURE': - return CTextFilter::ShortCodeFigure($matches[2]); + return CTextFilter::shortCodeFigure($matches[2]); break; case 'BASEURL': - return CTextFilter::ShortCodeBaseurl(); + return CTextFilter::shortCodeBaseurl(); break; case 'RELURL': - return CTextFilter::ShortCodeRelurl(); + return CTextFilter::shortCodeRelurl(); break; case 'ASSET': - return CTextFilter::ShortCodeAsset(); + return CTextFilter::shortCodeAsset(); break; default: @@ -234,7 +234,7 @@ class CTextFilter 'href' => null, 'nolink' => false, ], - CTextFilter::ShortCodeInit($options) + CTextFilter::shortCodeInit($options) ), EXTR_SKIP );
Fixed additional case-insenitive problems
mosbth_Anax-MVC
train
php
e65648398bc4522454dde7453c662bf2c3a7119a
diff --git a/gns3server/server.py b/gns3server/server.py index <HASH>..<HASH> 100644 --- a/gns3server/server.py +++ b/gns3server/server.py @@ -106,7 +106,7 @@ class Server: def _signal_handling(self): - def signal_handler(signame): + def signal_handler(signame, *args): log.warning("Server has got signal {}, exiting...".format(signame)) asyncio.async(self.shutdown_server())
Catch extra args in windows signal handler
GNS3_gns3-server
train
py
38724f8319a15fc5e5259164c2b32b48de347d99
diff --git a/src/Illuminate/Contracts/Validation/Validator.php b/src/Illuminate/Contracts/Validation/Validator.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Contracts/Validation/Validator.php +++ b/src/Illuminate/Contracts/Validation/Validator.php @@ -41,7 +41,7 @@ interface Validator extends MessageProvider /** * Get all of the validation error messages. * - * @return array + * @return \Illuminate\Support\MessageBag */ public function errors(); }
[<I>] Fixing the doc comments (#<I>) Fixing the `@return` type for the `Illuminate\Contracts\Validation@errors()` method.
laravel_framework
train
php