content_type
stringclasses
8 values
main_lang
stringclasses
7 values
message
stringlengths
1
50
sha
stringlengths
40
40
patch
stringlengths
52
962k
file_count
int64
1
300
PHP
PHP
add table_shema to select query
6e0e2cf09a910f37eb5f84bbafdbdf0063637934
<ide><path>src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php <ide> public function compileTableExists() <ide> * @param string $table <ide> * @return string <ide> */ <del> public function compileColumnExists($table) <add> public function compileColumnExists() <ide> { <del> return "select column_name from information_schema.columns where table_name = '$table'"; <add> return "select column_name from information_schema.columns where table_schema = ? and table_name = ?"; <ide> } <ide> <ide> /** <ide><path>src/Illuminate/Database/Schema/MySqlBuilder.php <ide> public function hasTable($table) <ide> return count($this->connection->select($sql, array($database, $table))) > 0; <ide> } <ide> <del>} <ide>\ No newline at end of file <add> /** <add> * Get the column listing for a given table. <add> * <add> * @param string $table <add> * @return array <add> */ <add> protected function getColumnListing($table) <add> { <add> $sql = $this->grammar->compileColumnExists(); <add> <add> $database = $this->connection->getDatabaseName(); <add> <add> $table = $this->connection->getTablePrefix().$table; <add> <add> $results = $this->connection->select($sql, array($database, $table)); <add> <add> return $this->connection->getPostProcessor()->processColumnListing($results); <add> } <add>}
2
Python
Python
add batteries % to the sensors list
87258ebf95c413eb2d89258dbb9c406b6d2891d5
<ide><path>glances/plugins/glances_batpercent.py <ide> class Plugin(GlancesPlugin): <ide> def __init__(self, args=None): <ide> GlancesPlugin.__init__(self, args=args) <ide> <del> #!!! TODO: display plugin... <del> <ide> # Init the sensor class <ide> self.glancesgrabbat = glancesGrabBat() <ide> <add> # We do not want to display the stat in a dedicated area <add> # The HDD temp is displayed within the sensors plugin <add> self.display_curse = False <add> <ide> # Init stats <ide> self.reset() <ide> <ide> def update(self): <ide> if self.get_input() == 'local': <ide> # Update stats using the standard system lib <ide> <del> self.stats = self.glancesgrabbat.getcapacitypercent() <add> self.stats = self.glancesgrabbat.get() <ide> <ide> elif self.get_input() == 'snmp': <ide> # Update stats using SNMP <ide> def __init__(self): <ide> self.initok = True <ide> self.bat_list = [] <ide> self.__update__() <del> except Exception: <add> except Exception as e: <add> print "Warning: Can not grab batterie sensor. Missing BatInfo lib (%s)" % e <ide> self.initok = False <ide> <add> <ide> def __update__(self): <ide> """ <ide> Update the stats <ide> """ <ide> if self.initok: <ide> try: <ide> self.bat.update() <del> except Exception: <add> except Exception as e: <ide> self.bat_list = [] <ide> else: <del> self.bat_list = self.bat.stat <add> self.bat_list = [] <add> new_item = { 'label': _("Batterie (%)"), <add> 'value': self.getcapacitypercent() } <add> self.bat_list.append(new_item) <ide> else: <ide> self.bat_list = [] <ide> <ide> def get(self): <ide> # Update the stats <del> self.__update__() <ide> return self.bat_list <ide> <ide> def getcapacitypercent(self): <del> if not self.initok or self.bat_list == []: <add> if not self.initok or self.bat.stat == []: <ide> return [] <add> <ide> # Init the bsum (sum of percent) and bcpt (number of batteries) <ide> # and Loop over batteries (yes a computer could have more than 1 battery) <ide> bsum = 0 <del> for bcpt in range(len(self.get())): <add> for bcpt in range(len(self.bat.stat)): <ide> try: <del> bsum = bsum + int(self.bat_list[bcpt].capacity) <add> bsum = bsum + int(self.bat.stat[bcpt].capacity) <ide> except ValueError: <ide> return [] <ide> bcpt = bcpt + 1 <add> <ide> # Return the global percent <ide> return int(bsum / bcpt) <ide><path>glances/plugins/glances_sensors.py <ide> <ide> # Import Glances lib <ide> from glances.core.glances_globals import is_py3 <del>from glances.plugins.glances_hddtemp import Plugin as HddTempPlugin <ide> from glances.plugins.glances_plugin import GlancesPlugin <add>from glances.plugins.glances_hddtemp import Plugin as HddTempPlugin <add>from glances.plugins.glances_batpercent import Plugin as BatPercentPlugin <ide> <ide> <ide> class Plugin(GlancesPlugin): <ide> def __init__(self, args=None): <ide> # Init the sensor class <ide> self.glancesgrabsensors = glancesGrabSensors() <ide> <del> # Instance for the CorePlugin in order to display the core number <add> # Instance for the HDDTemp Plugin in order to display the hard disks temperatures <ide> self.hddtemp_plugin = HddTempPlugin() <ide> <add> # Instance for the BatPercent in order to display the batteries capacities <add> self.batpercent_plugin = BatPercentPlugin() <add> <ide> # We want to display the stat in the curse interface <ide> self.display_curse = True <ide> # Set the message position <ide> def update(self): <ide> <ide> if self.get_input() == 'local': <ide> # Update stats using the standard system lib <del> self.hddtemp_plugin.update() <ide> self.stats = self.glancesgrabsensors.get() <del> self.stats.extend(self.hddtemp_plugin.stats) <add> # Append HDD temperature <add> hddtemp = self.hddtemp_plugin.update() <add> self.stats.extend(hddtemp) <add> # Append Batteries % <add> batpercent = self.batpercent_plugin.update() <add> self.stats.extend(batpercent) <ide> elif self.get_input() == 'snmp': <ide> # Update stats using SNMP <ide> # No standard: http://www.net-snmp.org/wiki/index.php/Net-SNMP_and_lm-sensors_on_Ubuntu_10.04
2
Java
Java
ignore null attributes in abstractview
9ce5a18d96deb1207889ade128210acfb6adaeaa
<ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/result/view/AbstractView.java <ide> public Mono<Void> render(@Nullable Map<String, ?> model, @Nullable MediaType con <ide> protected Mono<Map<String, Object>> getModelAttributes( <ide> @Nullable Map<String, ?> model, ServerWebExchange exchange) { <ide> <del> int size = (model != null ? model.size() : 0); <del> Map<String, Object> attributes = new ConcurrentHashMap<>(size); <add> Map<String, Object> attributes; <ide> if (model != null) { <del> attributes.putAll(model); <add> attributes = new ConcurrentHashMap<>(model.size()); <add> for (Map.Entry<String, ?> entry : model.entrySet()) { <add> if (entry.getValue() != null) { <add> attributes.put(entry.getKey(), entry.getValue()); <add> } <add> } <ide> } <add> else { <add> attributes = new ConcurrentHashMap<>(0); <add> } <add> <ide> //noinspection deprecation <ide> return resolveAsyncAttributes(attributes) <ide> .then(resolveAsyncAttributes(attributes, exchange))
1
Python
Python
add links to entities into the tpl_ent-template
7562fb53545f396848bd55e774adf1a6b1686af8
<ide><path>spacy/displacy/templates.py <ide> <mark class="entity" style="background: {bg}; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;"> <ide> {text} <ide> <span style="font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem">{label}</span> <add> <a style="text-decoration: none; color: black; font-weight: bold" href="{kb_url}">{kb_id}</a> <ide> </mark> <ide> """ <ide>
1
Go
Go
skip utf-8 bom bytes from dockerfile if exists
678c80f9256021ce74184fdd6b612d9dea377fba
<ide><path>builder/dockerfile/parser/parser.go <ide> package parser <ide> <ide> import ( <ide> "bufio" <add> "bytes" <ide> "fmt" <ide> "io" <ide> "regexp" <ide> func Parse(rwc io.Reader) (*Node, error) { <ide> root.StartLine = -1 <ide> scanner := bufio.NewScanner(rwc) <ide> <add> utf8bom := []byte{0xEF, 0xBB, 0xBF} <ide> for scanner.Scan() { <del> scannedLine := strings.TrimLeftFunc(scanner.Text(), unicode.IsSpace) <add> scannedBytes := scanner.Bytes() <add> // We trim UTF8 BOM <add> if currentLine == 0 { <add> scannedBytes = bytes.TrimPrefix(scannedBytes, utf8bom) <add> } <add> scannedLine := strings.TrimLeftFunc(string(scannedBytes), unicode.IsSpace) <ide> currentLine++ <ide> line, child, err := ParseLine(scannedLine) <ide> if err != nil { <ide><path>integration-cli/docker_cli_build_test.go <ide> foo2 <ide> c.Fatal(err) <ide> } <ide> } <add> <add>// Test case for #23221 <add>func (s *DockerSuite) TestBuildWithUTF8BOM(c *check.C) { <add> name := "test-with-utf8-bom" <add> dockerfile := []byte(`FROM busybox`) <add> bomDockerfile := append([]byte{0xEF, 0xBB, 0xBF}, dockerfile...) <add> ctx, err := fakeContextFromNewTempDir() <add> c.Assert(err, check.IsNil) <add> defer ctx.Close() <add> err = ctx.addFile("Dockerfile", bomDockerfile) <add> c.Assert(err, check.IsNil) <add> _, err = buildImageFromContext(name, ctx, true) <add> c.Assert(err, check.IsNil) <add>}
2
Javascript
Javascript
use .call instead of .apply. minor
056a729115c2c2299fafc6d1c31efe135a9c78e4
<ide><path>pdf.js <ide> var PDFFunction = (function() { <ide> if (!typeFn) <ide> error('Unknown type of function'); <ide> <del> typeFn.apply(this, [fn, dict]); <add> typeFn.call(this, fn, dict); <ide> }; <ide> <ide> constructor.prototype = {
1
Ruby
Ruby
use standard tab accessor
5ac4e4f0714ffb364ac528d1a9b6697ae1693bf6
<ide><path>Library/Homebrew/cmd/upgrade.rb <ide> def upgrade <ide> end <ide> <ide> def upgrade_formula f <del> # Generate using `for_keg` since the formula object points to a newer version <del> # that doesn't exist yet. Use `opt_prefix` to guard against keg-only installs. <del> # Also, guard against old installs that may not have an `opt_prefix` symlink. <del> tab = (f.opt_prefix.exist? ? Tab.for_keg(f.opt_prefix) : Tab.dummy_tab(f)) <add> tab = Tab.for_formula(f) <ide> outdated_keg = Keg.new(f.linked_keg.realpath) rescue nil <ide> <ide> installer = FormulaInstaller.new(f)
1
PHP
PHP
add a schema loader for cakephp core tests
f317944eb7fc99a2641095d1070fbd25c6d8683d
<ide><path>src/TestSuite/Schema/SchemaGenerator.php <add><?php <add>declare(strict_types=1); <add> <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 4.3.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\TestSuite\Schema; <add> <add>use Cake\Database\Schema\TableSchema; <add>use Cake\Datasource\ConnectionManager; <add>use RuntimeException; <add> <add>/** <add> * Create database schema from the provided metadata file. <add> * <add> * @internal <add> */ <add>class SchemaGenerator <add>{ <add> /** <add> * The metadata file to load. <add> * <add> * @var string <add> */ <add> protected $file; <add> <add> /** <add> * @var string <add> */ <add> protected $connection; <add> <add> /** <add> * Constructor <add> * <add> * @param string $file The file to load <add> * @param string $connection The connection to use. <add> * @return void <add> */ <add> public function __construct(string $file, string $connection) <add> { <add> $this->file = $file; <add> $this->connection = $connection; <add> } <add> <add> /** <add> * Reload the schema. <add> * <add> * Will drop all tables and re-create them from the metadata file. <add> * <add> * @param ?string[] $tables The list of tables to reset. Primarily for testing. <add> * @return void <add> */ <add> public function reload(?array $tables = null): void <add> { <add> if (!file_exists($this->file)) { <add> throw new RuntimeException("Cannot load `{$this->file}`"); <add> } <add> <add> $cleaner = new SchemaCleaner(); <add> $cleaner->dropTables($this->connection, $tables); <add> <add> $config = include $this->file; <add> $connection = ConnectionManager::get($this->connection); <add> <add> foreach ($config as $metadata) { <add> $table = new TableSchema($metadata['table'], $metadata['columns']); <add> if (isset($metadata['indexes'])) { <add> foreach ($metadata['indexes'] as $key => $index) { <add> $table->addIndex($key, $index); <add> } <add> } <add> if (isset($metadata['constraints'])) { <add> foreach ($metadata['constraints'] as $key => $index) { <add> $table->addConstraint($key, $index); <add> } <add> } <add> // Generate SQL for each table. <add> $stmts = $table->createSql($connection); <add> foreach ($stmts as $stmt) { <add> $connection->execute($stmt); <add> } <add> } <add> } <add>} <ide><path>tests/TestCase/TestSuite/Schema/SchemaGeneratorTest.php <add><?php <add>declare(strict_types=1); <add> <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 4.3.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Test\TestCase\TestSuite\Schema; <add> <add>use Cake\Datasource\ConnectionManager; <add>use Cake\TestSuite\Schema\SchemaGenerator; <add>use Cake\TestSuite\TestCase; <add> <add>/** <add> * SchemaGenerator Test <add> */ <add>class SchemaGeneratorTest extends TestCase <add>{ <add> /** <add> * test reload on a table subset. <add> * <add> * @return void <add> */ <add> public function testReload() <add> { <add> $generator = new SchemaGenerator(__DIR__ . '/test_schema.php', 'test'); <add> <add> // only drop tables we'll create again. <add> $tables = ['schema_generator', 'schema_generator_comment']; <add> $generator->reload($tables); <add> <add> $connection = ConnectionManager::get('test'); <add> $schema = $connection->getSchemaCollection(); <add> <add> $tables = $schema->listTables(); <add> $this->assertContains('schema_generator', $tables); <add> $this->assertContains('schema_generator_comment', $tables); <add> <add> foreach ($tables as $table) { <add> $meta = $schema->describe($table); <add> foreach ($meta->dropSql($connection) as $stmt) { <add> $connection->execute($stmt); <add> } <add> } <add> } <add>} <ide><path>tests/TestCase/TestSuite/Schema/test_schema.php <add><?php <add>declare(strict_types=1); <add> <add>return [ <add> [ <add> 'table' => 'schema_generator', <add> 'columns' => [ <add> 'id' => ['type' => 'integer'], <add> 'relation_id' => ['type' => 'integer', 'null' => true], <add> 'title' => ['type' => 'string', 'null' => true], <add> 'body' => 'text', <add> ], <add> 'constraints' => [ <add> 'primary' => ['type' => 'primary', 'columns' => ['id']], <add> 'relation_idx' => [ <add> 'type' => 'foreign', <add> 'columns' => ['relation_id'], <add> 'references' => ['schema_generator_comment', 'id'], <add> ], <add> ], <add> 'indexes' => [ <add> 'title_idx' => [ <add> 'type' => 'index', <add> 'columns' => ['title'], <add> ], <add> ], <add> ], <add> [ <add> 'table' => 'schema_generator_comment', <add> 'columns' => [ <add> 'id' => ['type' => 'integer'], <add> 'title' => ['type' => 'string', 'null' => true], <add> ], <add> ], <add>]; <ide><path>tests/bootstrap.php <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\Error\Debug\TextFormatter; <ide> use Cake\Log\Log; <add>use Cake\TestSuite\Schema\SchemaGenerator; <ide> use Cake\Utility\Security; <ide> <ide> if (is_file('vendor/autoload.php')) { <ide> // does not allow the sessionid to be set after stdout <ide> // has been written to. <ide> session_id('cli'); <add> <add>// Create test database schema. <add>$schema = new SchemaGenerator(CORE_TESTS . 'schema.php', 'test'); <add>$schema->reload(); <ide><path>tests/schema.php <add><?php <add>declare(strict_types=1); <add> <add>/** <add> * Abstract schema for CakePHP tests. <add> * <add> * This format resembles the existing fixture schema <add> * and is converted to SQL via the Schema generation <add> * features of the Database package. <add> */ <add>return [ <add>];
5
Python
Python
remove unused variables in templates
495580dad193b7a8405b717b60089574de6563c7
<ide><path>templates/adding_a_new_example_script/utils_xxx.py <ide> def write_predictions_extended( <ide> orig_data = json.load(reader)["data"] <ide> <ide> qid_to_has_ans = make_qid_to_has_ans(orig_data) <del> has_ans_qids = [k for k, v in qid_to_has_ans.items() if v] <del> no_ans_qids = [k for k, v in qid_to_has_ans.items() if not v] <ide> exact_raw, f1_raw = get_raw_scores(orig_data, all_predictions) <ide> out_eval = {} <ide>
1
Python
Python
replace pkg_resources with importlib_metadata
abb74300037de304823a9ce0b76973b4a477ed93
<ide><path>src/transformers/file_utils.py <ide> <ide> import requests <ide> from filelock import FileLock <add>from transformers.utils.versions import importlib_metadata <ide> <ide> from . import __version__ <ide> from .hf_api import HfFolder <ide> from .utils import logging <ide> <ide> <del># The package importlib_metadata is in a different place, depending on the python version. <del>if sys.version_info < (3, 8): <del> import importlib_metadata <del>else: <del> import importlib.metadata as importlib_metadata <del> <del> <ide> logger = logging.get_logger(__name__) # pylint: disable=invalid-name <ide> <ide> ENV_VARS_TRUE_VALUES = {"1", "ON", "YES", "TRUE"} <ide><path>src/transformers/utils/versions.py <ide> <ide> from packaging import version <ide> <del>import pkg_resources <add> <add># The package importlib_metadata is in a different place, depending on the python version. <add>if sys.version_info < (3, 8): <add> import importlib_metadata <add>else: <add> import importlib.metadata as importlib_metadata <ide> <ide> <ide> ops = { <ide> def require_version(requirement: str, hint: Optional[str] = None) -> None: <ide> """ <ide> Perform a runtime check of the dependency versions, using the exact same syntax used by pip. <ide> <del> The installed module version comes from the `site-packages` dir via `pkg_resources`. <add> The installed module version comes from the `site-packages` dir via `importlib_metadata`. <ide> <ide> Args: <ide> requirement (:obj:`str`): pip style definition, e.g., "tokenizers==0.9.4", "tqdm>=4.27", "numpy" <ide> def require_version(requirement: str, hint: Optional[str] = None) -> None: <ide> if pkg == "python": <ide> got_ver = ".".join([str(x) for x in sys.version_info[:3]]) <ide> if not ops[op](version.parse(got_ver), version.parse(want_ver)): <del> raise pkg_resources.VersionConflict( <add> raise ImportError( <ide> f"{requirement} is required for a normal functioning of this module, but found {pkg}=={got_ver}." <ide> ) <ide> return <ide> <ide> # check if any version is installed <ide> try: <del> got_ver = pkg_resources.get_distribution(pkg).version <del> except pkg_resources.DistributionNotFound: <del> raise pkg_resources.DistributionNotFound(requirement, ["this application", hint]) <add> got_ver = importlib_metadata.version(pkg) <add> except importlib_metadata.PackageNotFoundError: <add> raise importlib_metadata.PackageNotFoundError( <add> f"The '{requirement}' distribution was not found and is required by this application. {hint}" <add> ) <ide> <ide> # check that the right version is installed if version number was provided <ide> if want_ver is not None and not ops[op](version.parse(got_ver), version.parse(want_ver)): <del> raise pkg_resources.VersionConflict( <add> raise ImportError( <ide> f"{requirement} is required for a normal functioning of this module, but found {pkg}=={got_ver}.{hint}" <ide> ) <ide> <ide><path>tests/test_versions_utils.py <ide> <ide> import numpy <ide> <del>import pkg_resources <ide> from transformers.testing_utils import TestCasePlus <del>from transformers.utils.versions import require_version, require_version_core, require_version_examples <add>from transformers.utils.versions import ( <add> importlib_metadata, <add> require_version, <add> require_version_core, <add> require_version_examples, <add>) <ide> <ide> <ide> numpy_ver = numpy.__version__ <ide> def test_core(self): <ide> for req in ["numpy==1.0.0", "numpy>=1000.0.0", f"numpy<{numpy_ver}"]: <ide> try: <ide> require_version_core(req) <del> except pkg_resources.VersionConflict as e: <add> except ImportError as e: <ide> self.assertIn(f"{req} is required", str(e)) <ide> self.assertIn("but found", str(e)) <ide> <ide> # unmet requirements due to missing module <ide> for req in ["numpipypie>1", "numpipypie2"]: <ide> try: <ide> require_version_core(req) <del> except pkg_resources.DistributionNotFound as e: <add> except importlib_metadata.PackageNotFoundError as e: <ide> self.assertIn(f"The '{req}' distribution was not found and is required by this application", str(e)) <ide> self.assertIn("Try: pip install transformers -U", str(e)) <ide> <ide> def test_examples(self): <ide> # the main functionality is tested in `test_core`, this is just the hint check <ide> try: <ide> require_version_examples("numpy>1000.4.5") <del> except pkg_resources.VersionConflict as e: <add> except ImportError as e: <ide> self.assertIn("is required", str(e)) <ide> self.assertIn("pip install -r examples/requirements.txt", str(e)) <ide> <ide> def test_python(self): <ide> for req in ["python>9.9.9", "python<3.0.0"]: <ide> try: <ide> require_version_core(req) <del> except pkg_resources.VersionConflict as e: <add> except ImportError as e: <ide> self.assertIn(f"{req} is required", str(e)) <ide> self.assertIn(f"but found python=={python_ver}", str(e))
3
Python
Python
fix rackspace tests
0d1fdcec8864dda5e70259191bac3231e84b4df6
<ide><path>libcloud/test/compute/test_rackspace.py <ide> class RackspaceNovaLonTests(BaseRackspaceNovaTestCase, OpenStack_1_1_Tests): <ide> driver_args = RACKSPACE_NOVA_PARAMS <ide> driver_kwargs = {'region': 'lon'} <ide> <del> conn_classes = (RackspaceNovaLonMockHttp, RackspaceNovaLonMockHttp) <add> conn_classes = RackspaceNovaLonMockHttp <ide> auth_url = 'https://lon.auth.api.example.com' <ide> <ide> expected_endpoint = 'https://lon.servers.api.rackspacecloud.com/v2/1337'
1
Javascript
Javascript
fix wrong aspath on 404
c9e379c3bf3c028900f0feb7876590cf85fdb199
<ide><path>packages/next/client/index.js <ide> if ( <ide> page === '/_error' && <ide> hydrateProps && <ide> hydrateProps.pageProps && <del> hydrateProps.pageProps.statusCode === '404' <add> hydrateProps.pageProps.statusCode === 404 <ide> ) <ide> ) { <ide> asPath = delBasePath(asPath) <ide><path>test/integration/basepath/test/index.test.js <ide> const runTests = (context, dev = false) => { <ide> it('should not update URL for a 404', async () => { <ide> const browser = await webdriver(context.appPort, '/missing') <ide> const pathname = await browser.eval(() => window.location.pathname) <add> expect(await browser.eval(() => window.next.router.asPath)).toBe('/missing') <ide> expect(pathname).toBe('/missing') <ide> }) <ide>
2
PHP
PHP
add basepath() method to application contract
bfeaa370a77b9c853adae6faba4143ad683c0172
<ide><path>src/Illuminate/Contracts/Foundation/Application.php <ide> interface Application extends Container { <ide> * @return string <ide> */ <ide> public function version(); <add> <add> /** <add> * Get the base path of the Laravel installation. <add> * <add> * @return string <add> */ <add> public function basePath() <ide> <ide> /** <ide> * Get or check the current application environment.
1
Ruby
Ruby
remove redundant --greedy
8abe60d2dc3f010112aa671a82e4dceb22c11e5b
<ide><path>Library/Homebrew/test/cask/cli/upgrade_spec.rb <ide> end <ide> <ide> describe "with --greedy it checks additional Casks" do <del> it 'includes the Casks with "auto_updates true" or "version latest" with --greedy' do <add> it 'includes the Casks with "auto_updates true" or "version latest"' do <ide> local_caffeine = Hbc::CaskLoader.load("local-caffeine") <ide> local_caffeine_path = Hbc.appdir.join("Caffeine.app") <ide> auto_updates = Hbc::CaskLoader.load("auto-updates")
1
PHP
PHP
fix eager capture + syntactic sugar
fc779336bbf2559377d3409cf20f6b2db191d9fd
<ide><path>src/Illuminate/Database/Schema/ForeignIdColumnDefinition.php <ide> public function __construct(Blueprint $blueprint, $attributes = []) <ide> */ <ide> public function constrained($table = null, $column = 'id') <ide> { <del> return $this->references($column)->on($table ?: Str::plural(Str::before($this->name, '_'.$column))); <add> return $this->references($column)->on($table ?? Str::plural(Str::beforeLast($this->name, '_'.$column))); <ide> } <ide> <ide> /** <ide><path>tests/Database/DatabaseMySqlSchemaGrammarTest.php <ide> public function testAddingForeignID() <ide> $blueprint = new Blueprint('users'); <ide> $foreignId = $blueprint->foreignId('foo'); <ide> $blueprint->foreignId('company_id')->constrained(); <add> $blueprint->foreignId('laravel_idea_id')->constrained(); <ide> $blueprint->foreignId('team_id')->references('id')->on('teams'); <ide> $blueprint->foreignId('team_column_id')->constrained('teams'); <ide> <ide> $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); <ide> <ide> $this->assertInstanceOf(ForeignIdColumnDefinition::class, $foreignId); <ide> $this->assertSame([ <del> 'alter table `users` add `foo` bigint unsigned not null, add `company_id` bigint unsigned not null, add `team_id` bigint unsigned not null, add `team_column_id` bigint unsigned not null', <add> 'alter table `users` add `foo` bigint unsigned not null, add `company_id` bigint unsigned not null, add `laravel_idea_id` bigint unsigned not null, add `team_id` bigint unsigned not null, add `team_column_id` bigint unsigned not null', <ide> 'alter table `users` add constraint `users_company_id_foreign` foreign key (`company_id`) references `companies` (`id`)', <add> 'alter table `users` add constraint `users_laravel_idea_id_foreign` foreign key (`laravel_idea_id`) references `laravel_ideas` (`id`)', <ide> 'alter table `users` add constraint `users_team_id_foreign` foreign key (`team_id`) references `teams` (`id`)', <ide> 'alter table `users` add constraint `users_team_column_id_foreign` foreign key (`team_column_id`) references `teams` (`id`)', <ide> ], $statements); <ide><path>tests/Database/DatabasePostgresSchemaGrammarTest.php <ide> public function testAddingForeignID() <ide> $blueprint = new Blueprint('users'); <ide> $foreignId = $blueprint->foreignId('foo'); <ide> $blueprint->foreignId('company_id')->constrained(); <add> $blueprint->foreignId('laravel_idea_id')->constrained(); <ide> $blueprint->foreignId('team_id')->references('id')->on('teams'); <ide> $blueprint->foreignId('team_column_id')->constrained('teams'); <ide> <ide> $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); <ide> <ide> $this->assertInstanceOf(ForeignIdColumnDefinition::class, $foreignId); <ide> $this->assertSame([ <del> 'alter table "users" add column "foo" bigint not null, add column "company_id" bigint not null, add column "team_id" bigint not null, add column "team_column_id" bigint not null', <add> 'alter table "users" add column "foo" bigint not null, add column "company_id" bigint not null, add column "laravel_idea_id" bigint not null, add column "team_id" bigint not null, add column "team_column_id" bigint not null', <ide> 'alter table "users" add constraint "users_company_id_foreign" foreign key ("company_id") references "companies" ("id")', <add> 'alter table "users" add constraint "users_laravel_idea_id_foreign" foreign key ("laravel_idea_id") references "laravel_ideas" ("id")', <ide> 'alter table "users" add constraint "users_team_id_foreign" foreign key ("team_id") references "teams" ("id")', <ide> 'alter table "users" add constraint "users_team_column_id_foreign" foreign key ("team_column_id") references "teams" ("id")', <ide> ], $statements); <ide><path>tests/Database/DatabaseSQLiteSchemaGrammarTest.php <ide> public function testAddingForeignID() <ide> $blueprint = new Blueprint('users'); <ide> $foreignId = $blueprint->foreignId('foo'); <ide> $blueprint->foreignId('company_id')->constrained(); <add> $blueprint->foreignId('laravel_idea_id')->constrained(); <ide> $blueprint->foreignId('team_id')->references('id')->on('teams'); <ide> $blueprint->foreignId('team_column_id')->constrained('teams'); <ide> <ide> public function testAddingForeignID() <ide> $this->assertSame([ <ide> 'alter table "users" add column "foo" integer not null', <ide> 'alter table "users" add column "company_id" integer not null', <add> 'alter table "users" add column "laravel_idea_id" integer not null', <ide> 'alter table "users" add column "team_id" integer not null', <ide> 'alter table "users" add column "team_column_id" integer not null', <ide> ], $statements); <ide><path>tests/Database/DatabaseSqlServerSchemaGrammarTest.php <ide> public function testAddingForeignID() <ide> $blueprint = new Blueprint('users'); <ide> $foreignId = $blueprint->foreignId('foo'); <ide> $blueprint->foreignId('company_id')->constrained(); <add> $blueprint->foreignId('laravel_idea_id')->constrained(); <ide> $blueprint->foreignId('team_id')->references('id')->on('teams'); <ide> $blueprint->foreignId('team_column_id')->constrained('teams'); <ide> <ide> $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); <ide> <ide> $this->assertInstanceOf(ForeignIdColumnDefinition::class, $foreignId); <ide> $this->assertSame([ <del> 'alter table "users" add "foo" bigint not null, "company_id" bigint not null, "team_id" bigint not null, "team_column_id" bigint not null', <add> 'alter table "users" add "foo" bigint not null, "company_id" bigint not null, "laravel_idea_id" bigint not null, "team_id" bigint not null, "team_column_id" bigint not null', <ide> 'alter table "users" add constraint "users_company_id_foreign" foreign key ("company_id") references "companies" ("id")', <add> 'alter table "users" add constraint "users_laravel_idea_id_foreign" foreign key ("laravel_idea_id") references "laravel_ideas" ("id")', <ide> 'alter table "users" add constraint "users_team_id_foreign" foreign key ("team_id") references "teams" ("id")', <ide> 'alter table "users" add constraint "users_team_column_id_foreign" foreign key ("team_column_id") references "teams" ("id")', <ide> ], $statements);
5
Text
Text
fix spelling error
534824e23273d42d0a95cf43c6583615685a60f8
<ide><path>curriculum/challenges/english/05-apis-and-microservices/mongodb-and-mongoose/create-and-save-a-record-of-a-model.english.md <ide> In this challenge you will have to create and save a record of a model. <ide> <ide> ## Instructions <ide> <section id='instructions'> <del>Create a document instance using the <code>Person</code> constructor you built before. Pass to the constructor an object having the fields <code>name</code>, <code>age</code>, and <code>favoriteFoods</code>. Their types must be conformant to the ones in the Person Schema. Then call the method <code>document.save()</code> on the returned document instance. Pass to it a callback using the Node convention. This is a common pattern, all the following CRUD methods take a callback function like this as the last argument. <add>Create a document instance using the <code>Person</code> constructor you built before. Pass to the constructor an object having the fields <code>name</code>, <code>age</code>, and <code>favoriteFoods</code>. Their types must conform to the ones in the Person Schema. Then call the method <code>document.save()</code> on the returned document instance. Pass to it a callback using the Node convention. This is a common pattern, all the following CRUD methods take a callback function like this as the last argument. <ide> <blockquote> <ide> /* Example */<br><br> <ide> // ...<br>
1
Go
Go
add spec file support for windows plugin discovery
36cf93fb0c45ce62b3cb1e82e1ecae1486017c9b
<ide><path>pkg/plugins/discovery.go <ide> var ( <ide> // ErrNotFound plugin not found <ide> ErrNotFound = errors.New("plugin not found") <ide> socketsPath = "/run/docker/plugins" <del> specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} <ide> ) <ide> <ide> // localRegistry defines a registry that is local (using unix socket). <ide><path>pkg/plugins/discovery_unix.go <add>package plugins <add> <add>var specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} <ide><path>pkg/plugins/discovery_windows.go <add>package plugins <add> <add>import ( <add> "os" <add> "path/filepath" <add>) <add> <add>var specPaths = []string{filepath.Join(os.Getenv("programdata"), "docker", "plugins")}
3
PHP
PHP
use local configuration options
2ae5872a24a71094521c06b4f682e053f9ec8fe6
<ide><path>src/Illuminate/Broadcasting/BroadcastManager.php <ide> protected function callCustomCreator(array $config) <ide> */ <ide> protected function createPusherDriver(array $config) <ide> { <del> $pusher = new Pusher($config['key'], $config['secret'], <del> $config['app_id'], $config['options'] ?? []); <add> $pusher = new Pusher( <add> $config['key'], $config['secret'], <add> $config['app_id'], $config['options'] ?? [] <add> ); <ide> <del> if ($this->app->make('config')->get('app.debug')) { <del> $pusher->setLogger( <del> $this->app->make(LoggerInterface::class) <del> ); <add> if ($config['log'] ?? false) { <add> $pusher->setLogger($this->app->make(LoggerInterface::class)); <ide> } <ide> <ide> return new PusherBroadcaster($pusher);
1
Javascript
Javascript
fix path.relative() for prefixes at root
f296a7f16f641a432547b5c682fdbdc9cafbaac2
<ide><path>lib/path.js <ide> const win32 = { <ide> // We get here if `from` is the exact base path for `to`. <ide> // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz' <ide> return toOrig.slice(toStart + i + 1); <del> } else if (lastCommonSep === 2) { <add> } else if (i === 2) { <ide> // We get here if `from` is the device root. <ide> // For example: from='C:\\'; to='C:\\foo' <ide> return toOrig.slice(toStart + i); <ide> const win32 = { <ide> // We get here if `to` is the exact base path for `from`. <ide> // For example: from='C:\\foo\\bar'; to='C:\\foo' <ide> lastCommonSep = i; <del> } else if (lastCommonSep === 2) { <add> } else if (i === 2) { <ide> // We get here if `to` is the device root. <ide> // For example: from='C:\\foo\\bar'; to='C:\\' <ide> lastCommonSep = 3; <ide> const posix = { <ide> var i = 0; <ide> for (; i <= length; ++i) { <ide> if (i === length) { <del> if (lastCommonSep === -1) { <del> lastCommonSep = i; <del> } else if (toLen > length && to.charCodeAt(i + 1) === 47/*/*/) { <del> // We get here if `from` is the exact base path for `to`. <del> // For example: from='/foo/bar'; to='/foo/bar/baz' <del> return to.slice(i + 2); <del> } else if (fromLen > length && from.charCodeAt(i + 1) === 47/*/*/) { <del> // We get here if `to` is the exact base path for `from`. <del> // For example: from='/foo/bar/baz'; to='/foo/bar' <del> lastCommonSep = i; <add> if (toLen > length) { <add> if (to.charCodeAt(toStart + i) === 47/*/*/) { <add> // We get here if `from` is the exact base path for `to`. <add> // For example: from='/foo/bar'; to='/foo/bar/baz' <add> return to.slice(toStart + i + 1); <add> } else if (i === 0) { <add> // We get here if `from` is the root <add> // For example: from='/'; to='/foo' <add> return to.slice(toStart + i); <add> } <add> } else if (fromLen > length) { <add> if (from.charCodeAt(fromStart + i) === 47/*/*/) { <add> // We get here if `to` is the exact base path for `from`. <add> // For example: from='/foo/bar/baz'; to='/foo/bar' <add> lastCommonSep = i; <add> } else if (i === 0) { <add> // We get here if `to` is the root. <add> // For example: from='/foo'; to='/' <add> lastCommonSep = 0; <add> } <ide> } <ide> break; <ide> } <ide><path>test/parallel/test-path.js <ide> const relativeTests = [ <ide> ['\\\\foo\\bar', '\\\\foo\\bar\\baz', 'baz'], <ide> ['\\\\foo\\bar\\baz', '\\\\foo\\bar', '..'], <ide> ['\\\\foo\\bar\\baz-quux', '\\\\foo\\bar\\baz', '..\\baz'], <del> ['\\\\foo\\bar\\baz', '\\\\foo\\bar\\baz-quux', '..\\baz-quux'] <add> ['\\\\foo\\bar\\baz', '\\\\foo\\bar\\baz-quux', '..\\baz-quux'], <add> ['C:\\baz-quux', 'C:\\baz', '..\\baz'], <add> ['C:\\baz', 'C:\\baz-quux', '..\\baz-quux'], <add> ['\\\\foo\\baz-quux', '\\\\foo\\baz', '..\\baz'], <add> ['\\\\foo\\baz', '\\\\foo\\baz-quux', '..\\baz-quux'] <ide> ] <ide> ], <ide> [ path.posix.relative, <ide> const relativeTests = [ <ide> ['/foo/test', '/foo/test/bar/package.json', 'bar/package.json'], <ide> ['/Users/a/web/b/test/mails', '/Users/a/web/b', '../..'], <ide> ['/foo/bar/baz-quux', '/foo/bar/baz', '../baz'], <del> ['/foo/bar/baz', '/foo/bar/baz-quux', '../baz-quux'] <add> ['/foo/bar/baz', '/foo/bar/baz-quux', '../baz-quux'], <add> ['/baz-quux', '/baz', '../baz'], <add> ['/baz', '/baz-quux', '../baz-quux'] <ide> ] <ide> ] <ide> ];
2
PHP
PHP
improve comments in filter class
7f3baf9742e61d68b3be3ca0b4f13c6b176c1429
<ide><path>system/filter.php <ide> class Filter { <ide> */ <ide> public static function call($filters, $parameters = array(), $override = false) <ide> { <del> // -------------------------------------------------------------- <del> // Load the filters if necessary. <del> // -------------------------------------------------------------- <ide> if (is_null(static::$filters)) <ide> { <ide> static::$filters = require APP_PATH.'filters'.EXT;
1
Python
Python
allow specifying parse function
3256c49facca47e3da36842fe3239614c5608cd3
<ide><path>official/resnet/cifar10_main.py <ide> def preprocess_image(image, is_training): <ide> <ide> def input_fn(is_training, data_dir, batch_size, num_epochs=1, <ide> dtype=tf.float32, datasets_num_private_threads=None, <del> num_parallel_batches=1): <add> num_parallel_batches=1, parse_record_fn=parse_record): <ide> """Input function which provides batches for train or eval. <ide> <ide> Args: <ide> def input_fn(is_training, data_dir, batch_size, num_epochs=1, <ide> dtype: Data type to use for images/features <ide> datasets_num_private_threads: Number of private threads for tf.data. <ide> num_parallel_batches: Number of parallel batches for tf.data. <add> parse_record_fn: Function to use for parsing the records. <ide> <ide> Returns: <ide> A dataset that can be used for iteration. <ide> def input_fn(is_training, data_dir, batch_size, num_epochs=1, <ide> is_training=is_training, <ide> batch_size=batch_size, <ide> shuffle_buffer=_NUM_IMAGES['train'], <del> parse_record_fn=parse_record, <add> parse_record_fn=parse_record_fn, <ide> num_epochs=num_epochs, <ide> dtype=dtype, <ide> datasets_num_private_threads=datasets_num_private_threads, <ide><path>official/resnet/imagenet_main.py <ide> def parse_record(raw_record, is_training, dtype): <ide> <ide> def input_fn(is_training, data_dir, batch_size, num_epochs=1, <ide> dtype=tf.float32, datasets_num_private_threads=None, <del> num_parallel_batches=1): <add> num_parallel_batches=1, parse_record_fn=parse_record): <ide> """Input function which provides batches for train or eval. <ide> <ide> Args: <ide> def input_fn(is_training, data_dir, batch_size, num_epochs=1, <ide> dtype: Data type to use for images/features <ide> datasets_num_private_threads: Number of private threads for tf.data. <ide> num_parallel_batches: Number of parallel batches for tf.data. <add> parse_record_fn: Function to use for parsing the records. <ide> <ide> Returns: <ide> A dataset that can be used for iteration. <ide> def input_fn(is_training, data_dir, batch_size, num_epochs=1, <ide> is_training=is_training, <ide> batch_size=batch_size, <ide> shuffle_buffer=_SHUFFLE_BUFFER, <del> parse_record_fn=parse_record, <add> parse_record_fn=parse_record_fn, <ide> num_epochs=num_epochs, <ide> dtype=dtype, <ide> datasets_num_private_threads=datasets_num_private_threads,
2
Ruby
Ruby
drop unnecessary parens
d2dc4e559982774b8e7d1e3eb0cdf40c97180778
<ide><path>Library/Homebrew/extend/os/mac/keg_relocate.rb <ide> def expand_rpath(file, bad_name) <ide> suffix = bad_name.sub(/^@rpath/, "") <ide> <ide> file.rpaths.each do |rpath| <del> return (rpath/suffix) if (rpath/suffix).exist? <add> return rpath/suffix if (rpath/suffix).exist? <ide> end <ide> <ide> opoo "Could not find library #{bad_name} for #{file}"
1
Text
Text
simplify doc [ci skip]
72e11abeaf6500fa81ee2260fa446fcabcc2a944
<ide><path>guides/source/layouts_and_rendering.md <ide> You can also pass in arbitrary local variables to any partial you are rendering <ide> as: :item, locals: {title: "Products Page"} %> <ide> ``` <ide> <del>Would render a partial `_product.html.erb` once for each instance of `product` in the `@products` instance variable passing the instance to the partial as a local variable called `item` and to each partial, make the local variable `title` available with the value `Products Page`. <add>In this case, the partial will have access to a local variable `title` with the value "Products Page". <ide> <ide> TIP: Rails also makes a counter variable available within a partial called by the collection, named after the member of the collection followed by `_counter`. For example, if you're rendering `@products`, within the partial you can refer to `product_counter` to tell you how many times the partial has been rendered. This does not work in conjunction with the `as: :value` option. <ide>
1
PHP
PHP
fix some bugs in contains
605e7f0dc56da4e29fd06e332c33e60f23b80b38
<ide><path>src/Illuminate/Database/Eloquent/Collection.php <ide> public function add($item) <ide> */ <ide> public function contains($key, $value = null) <ide> { <del> if (func_num_args() == 1) <add> if (func_num_args() == 1 && ! $key instanceof Closure) <ide> { <del> return ! is_null($this->find($key)); <add> $key = $key instanceof Model ? $key->getKey() : $key; <add> <add> return $this->filter(function($m) use ($key) <add> { <add> return $m->getKey() === $key; <add> <add> })->count() > 0; <add> } <add> elseif (func_num_args() == 2) <add> { <add> return $this->where($key, $value)->count() > 0; <ide> } <ide> <del> return parent::contains($key, $value); <add> return parent::contains($key); <ide> } <ide> <ide> /**
1
Python
Python
remove long double test for repr round-trip
4d3cf3d11514342d8662012e6a7533ae8e81f53b
<ide><path>numpy/core/tests/test_scalarmath.py <ide> def test_int_from_long(self): <ide> <ide> <ide> class TestRepr(TestCase): <del> def test_float_repr(self): <del> for t in [np.float32, np.float64, np.longdouble]: <del> finfo=np.finfo(t) <del> last_fraction_bit_idx = finfo.nexp + finfo.nmant <del> last_exponent_bit_idx = finfo.nexp <del> storage_bytes = np.dtype(t).itemsize*8 <del> # could add some more types to the list below <del> for which in ['small denorm','small norm']: <del> # Values from http://en.wikipedia.org/wiki/IEEE_754 <del> constr = np.array([0x00]*storage_bytes,dtype=np.uint8) <del> if which == 'small denorm': <del> byte = last_fraction_bit_idx // 8 <del> bytebit = 7-(last_fraction_bit_idx % 8) <del> constr[byte] = 1<<bytebit <del> elif which == 'small norm': <del> byte = last_exponent_bit_idx // 8 <del> bytebit = 7-(last_exponent_bit_idx % 8) <del> constr[byte] = 1<<bytebit <del> else: <del> raise ValueError('hmm') <del> val = constr.view(t)[0] <del> val_repr = repr(val) <del> val2 = t(eval(val_repr)) <del> if t == np.longdouble: <del> # Skip longdouble - the eval() statement goes <del> # through a Python float, which will lose <del> # precision <del> continue <del> if not (val2 == 0 and val < 1e-100): <del> assert_equal(val, val2) <add> def _test_type_repr(self, t): <add> finfo=np.finfo(t) <add> last_fraction_bit_idx = finfo.nexp + finfo.nmant <add> last_exponent_bit_idx = finfo.nexp <add> storage_bytes = np.dtype(t).itemsize*8 <add> # could add some more types to the list below <add> for which in ['small denorm','small norm']: <add> # Values from http://en.wikipedia.org/wiki/IEEE_754 <add> constr = np.array([0x00]*storage_bytes,dtype=np.uint8) <add> if which == 'small denorm': <add> byte = last_fraction_bit_idx // 8 <add> bytebit = 7-(last_fraction_bit_idx % 8) <add> constr[byte] = 1<<bytebit <add> elif which == 'small norm': <add> byte = last_exponent_bit_idx // 8 <add> bytebit = 7-(last_exponent_bit_idx % 8) <add> constr[byte] = 1<<bytebit <add> else: <add> raise ValueError('hmm') <add> val = constr.view(t)[0] <add> val_repr = repr(val) <add> val2 = t(eval(val_repr)) <add> if not (val2 == 0 and val < 1e-100): <add> assert_equal(val, val2) <ide> <add> def test_float_repr(self): <add> # long double test cannot work, because eval goes through a python <add> # float <add> for t in [np.float32, np.float64]: <add> yield test_float_repr, t <ide> <ide> if __name__ == "__main__": <ide> run_module_suite()
1
Go
Go
add laura poitras to the names generator
883d1415355244b2a2710d0860e5019bc697839b
<ide><path>pkg/namesgenerator/names-generator.go <ide> var ( <ide> // Henri Poincaré made fundamental contributions in several fields of mathematics. https://en.wikipedia.org/wiki/Henri_Poincar%C3%A9 <ide> "poincare", <ide> <add> // Laura Poitras is a director and producer whose work, made possible by open source crypto tools, advances the causes of truth and freedom of information by reporting disclosures by whistleblowers such as Edward Snowden. https://en.wikipedia.org/wiki/Laura_Poitras <add> "poitras", <add> <ide> // Claudius Ptolemy - a Greco-Egyptian writer of Alexandria, known as a mathematician, astronomer, geographer, astrologer, and poet of a single epigram in the Greek Anthology - https://en.wikipedia.org/wiki/Ptolemy <ide> "ptolemy", <ide>
1
Javascript
Javascript
rewrote streams to be object oriented
99ffc9991e00210d9f4c2dc1a97fee5021553264
<ide><path>pdf.js <ide> var Stream = (function() { <ide> get length() { <ide> return this.end - this.start; <ide> }, <del> lookByte: function() { <del> if (this.pos >= this.end) <del> return; <del> return this.bytes[this.pos]; <del> }, <ide> getByte: function() { <ide> if (this.pos >= this.end) <ide> return; <ide> var Stream = (function() { <ide> return bytes.subarray(pos, end); <ide> }, <ide> lookChar: function() { <del> return String.fromCharCode(this.lookByte()); <add> if (this.pos >= this.end) <add> return; <add> return String.fromCharCode(this.bytes[this.pos]); <ide> }, <ide> getChar: function() { <del> return String.fromCharCode(this.getByte()); <add> if (this.pos >= this.end) <add> return; <add> return String.fromCharCode(this.bytes[this.pos++]); <ide> }, <ide> skip: function(n) { <ide> if (!n) <ide> var StringStream = (function() { <ide> return constructor; <ide> })(); <ide> <add>// super class for the decoding streams <add>var DecodeStream = (function() { <add> function constructor() { <add> this.pos = 0; <add> this.bufferLength = 0; <add> this.eof = false; <add> this.buffer = null; <add> } <add> <add> constructor.prototype = { <add> ensureBuffer: function(requested) { <add> var buffer = this.buffer; <add> var current = buffer ? buffer.byteLength : 0; <add> if (requested < current) <add> return buffer; <add> var size = 512; <add> while (size < requested) <add> size <<= 1; <add> var buffer2 = Uint8Array(size); <add> for (var i = 0; i < current; ++i) <add> buffer2[i] = buffer[i]; <add> return this.buffer = buffer2; <add> }, <add> getByte: function() { <add> var pos = this.pos; <add> while (this.bufferLength <= pos) { <add> if (this.eof) <add> return; <add> this.readBlock(); <add> } <add> return this.buffer[this.pos++]; <add> }, <add> getBytes: function(length) { <add> var pos = this.pos; <add> <add> this.ensureBuffer(pos + length); <add> while (!this.eof && this.bufferLength < pos + length) <add> this.readBlock(); <add> <add> var end = pos + length; <add> var bufEnd = this.bufferLength; <add> <add> if (end > bufEnd) <add> end = bufEnd; <add> <add> this.pos = end; <add> return this.buffer.subarray(pos, end) <add> }, <add> lookChar: function() { <add> var pos = this.pos; <add> while (this.bufferLength <= pos) { <add> if (this.eof) <add> return; <add> this.readBlock(); <add> } <add> return String.fromCharCode(this.buffer[this.pos]); <add> }, <add> getChar: function() { <add> var pos = this.pos; <add> while (this.bufferLength <= pos) { <add> if (this.eof) <add> return; <add> this.readBlock(); <add> } <add> return String.fromCharCode(this.buffer[this.pos++]); <add> }, <add> skip: function(n) { <add> if (!n) <add> n = 1; <add> this.pos += n; <add> } <add> }; <add> <add> return constructor; <add>})(); <add> <add> <add> <ide> var FlateStream = (function() { <ide> const codeLenCodeMap = Uint32Array([ <ide> 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 <ide> var FlateStream = (function() { <ide> <ide> this.bytes = bytes; <ide> this.bytesPos = bytesPos; <del> this.eof = false; <add> <ide> this.codeSize = 0; <ide> this.codeBuf = 0; <del> <del> this.pos = 0; <del> this.bufferLength = 0; <add> <add> DecodeStream.call(this); <ide> } <ide> <ide> constructor.prototype = { <ide> var FlateStream = (function() { <ide> this.bytesPos = bytesPos; <ide> return codeVal; <ide> }, <del> ensureBuffer: function(requested) { <del> var buffer = this.buffer; <del> var current = buffer ? buffer.byteLength : 0; <del> if (requested < current) <del> return buffer; <del> var size = 512; <del> while (size < requested) <del> size <<= 1; <del> var buffer2 = Uint8Array(size); <del> for (var i = 0; i < current; ++i) <del> buffer2[i] = buffer[i]; <del> return this.buffer = buffer2; <del> }, <del> getByte: function() { <del> var pos = this.pos; <del> while (this.bufferLength <= pos) { <del> if (this.eof) <del> return; <del> this.readBlock(); <del> } <del> return this.buffer[this.pos++]; <del> }, <del> getBytes: function(length) { <del> var pos = this.pos; <del> <del> while (!this.eof && this.bufferLength < pos + length) <del> this.readBlock(); <del> <del> var end = pos + length; <del> var bufEnd = this.bufferLength; <del> <del> if (end > bufEnd) <del> end = bufEnd; <del> <del> this.pos = end; <del> return this.buffer.subarray(pos, end) <del> }, <del> lookChar: function() { <del> var pos = this.pos; <del> while (this.bufferLength <= pos) { <del> if (this.eof) <del> return; <del> this.readBlock(); <del> } <del> return String.fromCharCode(this.buffer[pos]); <del> }, <del> getChar: function() { <del> var ch = this.lookChar(); <del> // shouldnt matter what the position is if we get past the eof <del> // so no need to check if ch is undefined <del> this.pos++; <del> return ch; <del> }, <del> skip: function(n) { <del> if (!n) <del> n = 1; <del> this.pos += n; <del> }, <ide> generateHuffmanTable: function(lengths) { <ide> var n = lengths.length; <ide> <ide> var FlateStream = (function() { <ide> } <ide> } <ide> <del> litCodeTable = this.generateHuffmanTable(codeLengths.slice(0, numLitCodes)); <del> distCodeTable = this.generateHuffmanTable(codeLengths.slice(numLitCodes, codes)); <add> litCodeTable = this.generateHuffmanTable( <add> codeLengths.slice(0, numLitCodes)); <add> distCodeTable = this.generateHuffmanTable( <add> codeLengths.slice(numLitCodes, codes)); <ide> } else { <ide> error("Unknown block type in flate stream"); <ide> } <ide> var FlateStream = (function() { <ide> } <ide> }; <ide> <del> return constructor; <del>})(); <del>// A JpegStream can't be read directly. We use the platform to render the underlying <del>// JPEG data for us. <del>var JpegStream = (function() { <del> function constructor(bytes, dict) { <del> // TODO: per poppler, some images may have "junk" before that need to be removed <del> this.dict = dict; <del> <del> // create DOM image <del> var img = new Image(); <del> img.src = "data:image/jpeg;base64," + window.btoa(bytesToString(bytes)); <del> this.domImage = img; <add> var thisPrototype = constructor.prototype; <add> var superPrototype = DecodeStream.prototype; <add> for (var i in superPrototype) { <add> if (!thisPrototype[i]) <add> thisPrototype[i] = superPrototype[i]; <ide> } <ide> <del> constructor.prototype = { <del> getImage: function() { <del> return this.domImage; <del> }, <del> getChar: function() { <del> error("internal error: getChar is not valid on JpegStream"); <del> } <del> }; <del> <ide> return constructor; <ide> })(); <ide> <ide> var PredictorStream = (function() { <ide> error("Unsupported predictor"); <ide> <ide> if (predictor === 2) <del> this.readRow = this.readRowTiff; <add> this.readBlock = this.readBlockTiff; <ide> else <del> this.readRow = this.readRowPng; <add> this.readBlock = this.readBlockPng; <ide> <ide> this.stream = stream; <ide> this.dict = stream.dict; <ide> var PredictorStream = (function() { <ide> <ide> var pixBytes = this.pixBytes = (colors * bits + 7) >> 3; <ide> // add an extra pixByte to represent the pixel left of column 0 <del> var rowBytes = this.rowBytes = ((columns * colors * bits + 7) >> 3) + pixBytes; <del> <del> this.currentRow = new Uint8Array(rowBytes); <del> this.bufferLength = rowBytes; <del> this.pos = rowBytes; <add> var rowBytes = this.rowBytes = (columns * colors * bits + 7) >> 3; <add> <add> DecodeStream.call(this); <ide> } <ide> <ide> constructor.prototype = { <del> readRowTiff : function() { <del> var currentRow = this.currentRow; <add> readBlockTiff : function() { <add> var buffer = this.buffer; <add> var pos = this.pos; <add> <ide> var rowBytes = this.rowBytes; <ide> var pixBytes = this.pixBytes; <add> <add> <add> var buffer = this.buffer; <add> var bufferLength = this.bufferLength; <add> this.ensureBuffer(bufferLength + rowBytes); <add> var currentRow = buffer.subarray(bufferLength, bufferLength + rowBytes); <add> <ide> var bits = this.bits; <ide> var colors = this.colors; <ide> <del> var rawBytes = this.stream.getBytes(rowBytes - pixBytes); <del> <add> var rawBytes = this.stream.getBytes(rowBytes); <add> <ide> if (bits === 1) { <ide> var inbuf = 0; <del> for (var i = pixBytes, j = 0; i < rowBytes; ++i, ++j) { <del> var c = rawBytes[j]; <add> for (var i = 0; i < rowBytes; ++i) { <add> var c = rawBytes[i]; <ide> inBuf = (inBuf << 8) | c; <ide> // bitwise addition is exclusive or <ide> // first shift inBuf and then add <ide> var PredictorStream = (function() { <ide> inBuf &= 0xFFFF; <ide> } <ide> } else if (bits === 8) { <del> for (var i = pixBytes, j = 0; i < rowBytes; ++i, ++j) <del> currentRow[i] = currentRow[i - colors] + rawBytes[j]; <add> for (var i = 0; i < colors; ++i) <add> currentRow[i] = rawBytes[i]; <add> for (; i < rowBytes; ++i) <add> currentRow[i] = currentRow[i - colors] + rawBytes[i]; <ide> } else { <ide> var compArray = new Uint8Array(colors + 1); <ide> var bitMask = (1 << bits) - 1; <ide> var inbuf = 0, outbut = 0; <ide> var inbits = 0, outbits = 0; <del> var j = 0, k = pixBytes; <add> var j = 0, k = 0; <ide> var columns = this.columns; <ide> for (var i = 0; i < columns; ++i) { <ide> for (var kk = 0; kk < colors; ++kk) { <ide> var PredictorStream = (function() { <ide> (inbuf & ((1 << (8 - outbits)) - 1)) <ide> } <ide> } <del> this.pos = pixBytes; <add> this.bufferLength += rowBytes; <ide> }, <del> readRowPng : function() { <del> var currentRow = this.currentRow; <add> readBlockPng : function() { <add> var buffer = this.buffer; <add> var pos = this.pos; <ide> <ide> var rowBytes = this.rowBytes; <ide> var pixBytes = this.pixBytes; <ide> <ide> var predictor = this.stream.getByte(); <del> var rawBytes = this.stream.getBytes(rowBytes - pixBytes); <add> var rawBytes = this.stream.getBytes(rowBytes); <add> <add> var buffer = this.buffer; <add> var bufferLength = this.bufferLength; <add> this.ensureBuffer(bufferLength + pixBytes); <add> <add> var currentRow = buffer.subarray(bufferLength, bufferLength + rowBytes); <add> var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); <add> if (prevRow.length == 0) <add> prevRow = currentRow; <ide> <ide> switch (predictor) { <ide> case 0: <ide> break; <ide> case 1: <del> for (var i = pixBytes, j = 0; i < rowBytes; ++i, ++j) <del> currentRow[i] = (currentRow[i - pixBytes] + rawBytes[j]) & 0xFF; <add> for (var i = 0; i < pixBytes; ++i) <add> currentRow[i] = rawBytes[i]; <add> for (; i < rowBytes; ++i) <add> currentRow[i] = (currentRow[i - pixBytes] + rawBytes[i]) & 0xFF; <ide> break; <ide> case 2: <del> for (var i = pixBytes, j = 0; i < rowBytes; ++i, ++j) <del> currentRow[i] = (currentRow[i] + rawBytes[j]) & 0xFF; <add> for (var i = 0; i < rowBytes; ++i) <add> currentRow[i] = (prevRow[i] + rawBytes[i]) & 0xFF; <ide> break; <ide> case 3: <del> for (var i = pixBytes, j = 0; i < rowBytes; ++i, ++j) <del> currentRow[i] = (((currentRow[i] + currentRow[i - pixBytes]) <del> >> 1) + rawBytes[j]) & 0xFF; <add> for (var i = 0; i < pixBytes; ++i) <add> currentRow[i] = (prevRow[i] >> 1) + rawBytes[i]; <add> for (; i < rowBytes; ++i) <add> currentRow[i] = (((prevRow[i] + currentRow[i - pixBytes]) <add> >> 1) + rawBytes[i]) & 0xFF; <ide> break; <ide> case 4: <ide> // we need to save the up left pixels values. the simplest way <ide> // is to create a new buffer <del> var lastRow = currentRow; <del> var currentRow = new Uint8Array(rowBytes); <del> for (var i = pixBytes, j = 0; i < rowBytes; ++i, ++j) { <del> var up = lastRow[i]; <add> for (var i = 0; i < pixBytes; ++i) <add> currentRow[i] = rawBytes[i]; <add> for (; i < rowBytes; ++i) { <add> var up = prevRow[i]; <ide> var upLeft = lastRow[i - pixBytes]; <ide> var left = currentRow[i - pixBytes]; <ide> var p = left + up - upLeft; <ide> var PredictorStream = (function() { <ide> if (pc < 0) <ide> pc = -pc; <ide> <del> var c = rawBytes[j]; <add> var c = rawBytes[i]; <ide> if (pa <= pb && pa <= pc) <ide> currentRow[i] = left + c; <ide> else if (pb <= pc) <ide> currentRow[i] = up + c; <ide> else <ide> currentRow[i] = upLeft + c; <ide> break; <del> this.currentRow = currentRow; <ide> } <ide> default: <ide> error("Unsupported predictor"); <ide> break; <ide> } <del> this.pos = pixBytes; <del> }, <del> getByte : function() { <del> if (this.pos >= this.bufferLength) <del> this.readRow(); <del> return this.currentRow[this.pos++]; <del> }, <del> getBytes : function(n) { <del> var i, bytes; <del> bytes = new Uint8Array(n); <del> for (i = 0; i < n; ++i) { <del> if (this.pos >= this.bufferLength) <del> this.readRow(); <del> bytes[i] = this.currentRow[this.pos++]; <del> } <del> return bytes; <del> }, <del> getChar : function() { <del> return String.formCharCode(this.getByte()); <add> this.bufferLength += rowBytes; <ide> }, <del> lookChar : function() { <del> if (this.pos >= this.bufferLength) <del> this.readRow(); <del> return String.formCharCode(this.currentRow[this.pos]); <add> }; <add> <add> var thisPrototype = constructor.prototype; <add> var superPrototype = DecodeStream.prototype; <add> for (var i in superPrototype) { <add> if (!thisPrototype[i]) <add> thisPrototype[i] = superPrototype[i]; <add> } <add> <add> return constructor; <add>})(); <add> <add>// A JpegStream can't be read directly. We use the platform to render the underlying <add>// JPEG data for us. <add>var JpegStream = (function() { <add> function constructor(bytes, dict) { <add> // TODO: per poppler, some images may have "junk" before that need to be removed <add> this.dict = dict; <add> <add> // create DOM image <add> var img = new Image(); <add> img.src = "data:image/jpeg;base64," + window.btoa(bytesToString(bytes)); <add> this.domImage = img; <add> } <add> <add> constructor.prototype = { <add> getImage: function() { <add> return this.domImage; <ide> }, <del> skip : function(n) { <del> var i; <del> if (!n) { <del> n = 1; <del> } <del> while (n > this.bufferLength - this.pos) { <del> n -= this.bufferLength - this.pos; <del> this.readRow(); <del> if (this.bufferLength === 0) break; <del> } <del> this.pos += n; <add> getChar: function() { <add> error("internal error: getChar is not valid on JpegStream"); <ide> } <ide> }; <ide> <ide> return constructor; <ide> })(); <del> <ide> var DecryptStream = (function() { <ide> function constructor(str, fileKey, encAlgorithm, keyLength) { <ide> TODO("decrypt stream is not implemented");
1
PHP
PHP
remove useless `use`
11744da4ca866a291a305f6bf9d3b1bc3de18f84
<ide><path>tests/TestCase/Form/FormTest.php <ide> use Cake\Form\Schema; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\Validation\Validator; <del>use RuntimeException; <ide> use TestApp\Form\AppForm; <ide> use TestApp\Form\FormSchema; <ide>
1
Text
Text
add migration guide for cli commands
011c07a9bf415879e94b1271d4cc832c0a45b138
<ide><path>UPDATING.md <ide> with third party services to the ``airflow.providers`` package. <ide> All changes made are backward compatible, but if you use the old import paths you will <ide> see a deprecation warning. The old import paths can be abandoned in the future. <ide> <del>### CLI changes <add>### CLI changes in Airflow 2.0 <ide> <ide> The Airflow CLI has been organized so that related commands are grouped together as subcommands, <ide> which means that if you use these commands in your scripts, you have to make changes to them. <ide> <ide> This section describes the changes that have been made, and what you need to do to update your script. <ide> <del>#### Simplification of CLI commands <add>The ability to manipulate users from the command line has been changed. ``airflow create_user``, ``airflow delete_user`` <add> and ``airflow list_users`` has been grouped to a single command `airflow users` with optional flags `create`, `list` and `delete`. <ide> <del>The ability to manipulate users from the command line has been changed. 'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has been grouped to a single command `airflow users` with optional flags `--create`, `--list` and `--delete`. <add>The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is `airflow dags pause`, etc. <ide> <del>Example Usage: <add>In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a difference in behavior. In Airflow 1.10, <add>it prints all config options while in Airflow 2.0, it's a command group. `airflow config` is now `airflow config list`. <add>You can check other options by running the command `airflow config --help` <add> <add>For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html. <add> <add>You can learn about the commands by running ``airflow --help``. For example to get help about the ``celery`` group command, <add>you have to run the help command: ``airflow celery --help``. <add> <add>| Old command | New command | Group | <add>|-----------------------------|------------------------------------|--------------------| <add>| ``airflow worker`` | ``airflow celery worker`` | ``celery`` | <add>| ``airflow flower`` | ``airflow celery flower`` | ``celery`` | <add>| ``airflow trigger_dag`` | ``airflow dags trigger`` | ``dags`` | <add>| ``airflow delete_dag`` | ``airflow dags delete`` | ``dags`` | <add>| ``airflow show_dag`` | ``airflow dags show`` | ``dags`` | <add>| ``airflow list_dag`` | ``airflow dags list`` | ``dags`` | <add>| ``airflow dag_status`` | ``airflow dags status`` | ``dags`` | <add>| ``airflow backfill`` | ``airflow dags backfill`` | ``dags`` | <add>| ``airflow list_dag_runs`` | ``airflow dags list_runs`` | ``dags`` | <add>| ``airflow pause`` | ``airflow dags pause`` | ``dags`` | <add>| ``airflow unpause`` | ``airflow dags unpause`` | ``dags`` | <add>| ``airflow test`` | ``airflow tasks test`` | ``tasks`` | <add>| ``airflow clear`` | ``airflow tasks clear`` | ``tasks`` | <add>| ``airflow list_tasks`` | ``airflow tasks list`` | ``tasks`` | <add>| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` | ``tasks`` | <add>| ``airflow task_state`` | ``airflow tasks state`` | ``tasks`` | <add>| ``airflow run`` | ``airflow tasks run`` | ``tasks`` | <add>| ``airflow render`` | ``airflow tasks render`` | ``tasks`` | <add>| ``airflow initdb`` | ``airflow db init`` | ``db`` | <add>| ``airflow resetdb`` | ``airflow db reset`` | ``db`` | <add>| ``airflow upgradedb`` | ``airflow db upgrade`` | ``db`` | <add>| ``airflow checkdb`` | ``airflow db check`` | ``db`` | <add>| ``airflow shell`` | ``airflow db shell`` | ``db`` | <add>| ``airflow pool`` | ``airflow pools`` | ``pools`` | <add>| ``airflow create_user`` | ``airflow users create`` | ``users`` | <add>| ``airflow delete_user`` | ``airflow users delete`` | ``users`` | <add>| ``airflow list_users`` | ``airflow users list`` | ``users`` | <add> <add> <add>Example Usage for the ``users`` group: <ide> <ide> To create a new user: <ide> ```bash <del>airflow users --create --username jondoe --lastname doe --firstname jon --email [email protected] --role Viewer --password test <add>airflow users create --username jondoe --lastname doe --firstname jon --email [email protected] --role Viewer --password test <ide> ``` <ide> <ide> To list users: <ide> ```bash <del>airflow users --list <add>airflow users list <ide> ``` <ide> <ide> To delete a user: <ide> ```bash <del>airflow users --delete --username jondoe <add>airflow users delete --username jondoe <ide> ``` <ide> <ide> To add a user to a role: <ide> ```bash <del>airflow users --add-role --username jondoe --role Public <add>airflow users add-role --username jondoe --role Public <ide> ``` <ide> <ide> To remove a user from a role: <ide> ```bash <del>airflow users --remove-role --username jondoe --role Public <add>airflow users remove-role --username jondoe --role Public <ide> ``` <ide> <del>#### CLI reorganization <del> <del>The Airflow CLI has been organized so that related commands are grouped <del>together as subcommands. The `airflow list_dags` command is now `airflow <del>dags list`, `airflow pause` is `airflow dags pause`, `airflow config` is `airflow config list`, etc. <del>For a complete list of updated CLI commands, see https://airflow.apache.org/cli.html. <del> <del>#### Grouped to improve UX of CLI <del> <del>Some commands have been grouped to improve UX of CLI. New commands are available according to the following table: <del> <del>| Old command | New command | <del>|---------------------------|------------------------------------| <del>| ``airflow worker`` | ``airflow celery worker`` | <del>| ``airflow flower`` | ``airflow celery flower`` | <del> <del>#### Cli use exactly single character for short option style change <add>#### Use exactly single character for short option style change in CLI <ide> <ide> For Airflow short option, use exactly one single character, New commands are available according to the following table: <ide>
1
Ruby
Ruby
remove some evals from callback conditionals
a63a964a5d1ed02cf0df1b1a33a96ed2a9fa987b
<ide><path>activemodel/lib/active_model/callbacks.rb <ide> def _define_after_model_callback(klass, callback) #:nodoc: <ide> klass.define_singleton_method("after_#{callback}") do |*args, &block| <ide> options = args.extract_options! <ide> options[:prepend] = true <del> options[:if] = Array(options[:if]) << "value != false" <add> conditional = ActiveSupport::Callbacks::Conditionals::Value.new { |v| <add> v != false <add> } <add> options[:if] = Array(options[:if]) << conditional <ide> set_callback(:"#{callback}", :after, *(args << options), &block) <ide> end <ide> end <ide><path>activemodel/lib/active_model/validations.rb <ide> def validate(*args, &block) <ide> if options.key?(:on) <ide> options = options.dup <ide> options[:if] = Array(options[:if]) <del> options[:if].unshift("validation_context == :#{options[:on]}") <add> options[:if].unshift lambda { |o| <add> o.validation_context == options[:on] <add> } <ide> end <ide> args << options <ide> set_callback(:validate, *args, &block) <ide><path>activesupport/lib/active_support/callbacks.rb <ide> def run_callbacks(kind, &block) <ide> def halted_callback_hook(filter) <ide> end <ide> <add> module Conditionals # :nodoc: <add> class Value <add> def initialize(&block) <add> @block = block <add> end <add> def call(target, value); @block.call(value); end <add> end <add> end <add> <ide> module Filters <ide> Environment = Struct.new(:target, :halted, :value, :run_block) <ide> <ide> def make_lambda(filter) <ide> when String <ide> l = eval "lambda { |value| #{filter} }" <ide> lambda { |target, value| target.instance_exec(value, &l) } <add> when Conditionals::Value then filter <ide> when ::Proc <ide> if filter.arity > 1 <ide> return lambda { |target, _, &block|
3
Python
Python
fix duplicate function name in test cases
6bb3e3aeb92af10743874e0f95911a9c7ffa9da2
<ide><path>test/__init__.py <ide> def test_list_images_response(self): <ide> self.assertTrue(isinstance(image, NodeImage)) <ide> <ide> <del> def test_list_images_response(self): <add> def test_list_locations_response(self): <ide> locations = self.driver.list_locations() <ide> self.assertTrue(isinstance(locations, list)) <ide> for dc in locations:
1
Ruby
Ruby
apply edits from @senny to close [ci skip]
93d2eeaad5f7e2a362297384fb840461980f675e
<ide><path>activerecord/lib/active_record/associations.rb <ide> def belongs_to(name, scope = nil, options = {}) <ide> # <ide> # class CreateDevelopersProjectsJoinTable < ActiveRecord::Migration <ide> # def change <del> # create_table :developers_projects, id: false do |t| <del> # t.integer :developer_id <del> # t.integer :project_id <del> # end <add> # create_join_table :developers, :projects <ide> # end <ide> # end <ide> #
1
Ruby
Ruby
remove deprecated method call in fixtureset
c9a0f1ab9616ca8e94f03327259ab61d22f04b51
<ide><path>activerecord/lib/active_record/fixture_set/table_rows.rb <ide> module ActiveRecord <ide> class FixtureSet <ide> class TableRows # :nodoc: <del> def initialize(table_name, model_class:, fixtures:, config:) <add> def initialize(table_name, model_class:, fixtures:) <ide> @model_class = model_class <ide> <ide> # track any join tables we need to insert later <ide> def initialize(table_name, model_class:, fixtures:, config:) <ide> # ensure this table is loaded before any HABTM associations <ide> @tables[table_name] = nil <ide> <del> build_table_rows_from(table_name, fixtures, config) <add> build_table_rows_from(table_name, fixtures) <ide> end <ide> <ide> attr_reader :tables, :model_class <ide> def model_metadata <ide> end <ide> <ide> private <del> def build_table_rows_from(table_name, fixtures, config) <del> now = config.default_timezone == :utc ? Time.now.utc : Time.now <add> def build_table_rows_from(table_name, fixtures) <add> now = ActiveRecord.default_timezone == :utc ? Time.now.utc : Time.now <ide> <ide> @tables[table_name] = fixtures.map do |label, fixture| <ide> TableRow.new( <ide><path>activerecord/lib/active_record/fixtures.rb <ide> def table_rows <ide> table_name, <ide> model_class: model_class, <ide> fixtures: fixtures, <del> config: config, <ide> ).to_hash <ide> end <ide>
2
Python
Python
use python 3 style super calls
89e5acc1e2d57ec0c5419956023db27751a47545
<ide><path>tests/providers/exasol/hooks/test_exasol.py <ide> <ide> class TestExasolHookConn(unittest.TestCase): <ide> def setUp(self): <del> super(TestExasolHookConn, self).setUp() <add> super().setUp() <ide> <ide> self.connection = models.Connection( <ide> login='login', <ide> def test_get_conn_extra_args(self, mock_pyexasol): <ide> <ide> class TestExasolHook(unittest.TestCase): <ide> def setUp(self): <del> super(TestExasolHook, self).setUp() <add> super().setUp() <ide> <ide> self.cur = mock.MagicMock() <ide> self.conn = mock.MagicMock() <ide><path>tests/sensors/test_smart_sensor_operator.py <ide> def __init__(self, <ide> shard_max=conf.getint('smart_sensor', 'shard_code_upper_limit'), <ide> shard_min=0, <ide> **kwargs): <del> super(DummySmartSensor, self).__init__(shard_min=shard_min, <del> shard_max=shard_max, <del> **kwargs) <add> super().__init__(shard_min=shard_min, <add> shard_max=shard_max, <add> **kwargs) <ide> <ide> <ide> class DummySensor(BaseSensorOperator): <ide> poke_context_fields = ('input_field', 'return_value') <ide> exec_fields = ('soft_fail', 'execution_timeout', 'timeout') <ide> <ide> def __init__(self, input_field='test', return_value=False, **kwargs): <del> super(DummySensor, self).__init__(**kwargs) <add> super().__init__(**kwargs) <ide> self.input_field = input_field <ide> self.return_value = return_value <ide> <ide><path>tests/test_utils/mock_operators.py <ide> def operator_extra_links(self): <ide> <ide> @apply_defaults <ide> def __init__(self, bash_command=None, **kwargs): <del> super(CustomOperator, self).__init__(**kwargs) <add> super().__init__(**kwargs) <ide> self.bash_command = bash_command <ide> <ide> def execute(self, context):
3
Javascript
Javascript
change variable name to be more descriptive
7d55b8199960d92ec2ea6fe6b168674b3bb4005b
<ide><path>lib/url.js <ide> const querystring = require('querystring'); <ide> function urlParse(url, parseQueryString, slashesDenoteHost) { <ide> if (url instanceof Url) return url; <ide> <del> var u = new Url(); <del> u.parse(url, parseQueryString, slashesDenoteHost); <del> return u; <add> var urlObject = new Url(); <add> urlObject.parse(url, parseQueryString, slashesDenoteHost); <add> return urlObject; <ide> } <ide> <ide> Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) {
1
Python
Python
fix _shift_right function in tft5pretrainedmodel
06f1692b023a701ab2bb443fa4f0bdd58c6bd234
<ide><path>src/transformers/modeling_tf_t5.py <ide> def _shift_right(self, input_ids): <ide> decoder_start_token_id is not None <ide> ), "self.model.config.decoder_start_token_id has to be defined. In TF T5 it is usually set to the pad_token_id. See T5 docs for more information" <ide> <del> # shift inputs to the right <del> shifted_input_ids = tf.zeros_like(input_ids, dtype=tf.int32) <add> shifted_input_ids = tf.cast(input_ids, tf.int32) <ide> shifted_input_ids = tf.roll(shifted_input_ids, 1, axis=-1) <ide> start_tokens = tf.fill((shape_list(shifted_input_ids)[0], 1), decoder_start_token_id) <ide> shifted_input_ids = tf.concat([start_tokens, shifted_input_ids[:, 1:]], -1) <ide> def _shift_right(self, input_ids): <ide> shifted_input_ids == -100, tf.fill(shape_list(shifted_input_ids), pad_token_id), shifted_input_ids <ide> ) <ide> <del> assert tf.math.reduce_any( <del> shifted_input_ids >= 0 <del> ).numpy(), "Verify that `labels` has only positive values and -100" <add> # "Verify that `labels` has only positive values and -100" <add> assert_gte0 = tf.debugging.assert_greater_equal(shifted_input_ids, tf.cast(0, tf.int32)) <add> <add> # Make sure the assertion op is called by wrapping the result in an identity no-op <add> with tf.control_dependencies([assert_gte0]): <add> shifted_input_ids = tf.identity(shifted_input_ids) <ide> <ide> return shifted_input_ids <ide>
1
Go
Go
unify numcpu implementation
6919b9879ba05c56c43c3c1d0059f44441145220
<ide><path>pkg/sysinfo/numcpu.go <del>//go:build !linux && !windows <del>// +build !linux,!windows <del> <ide> package sysinfo // import "github.com/docker/docker/pkg/sysinfo" <ide> <ide> import ( <ide> "runtime" <ide> ) <ide> <del>// NumCPU returns the number of CPUs <add>// NumCPU returns the number of CPUs. On Linux and Windows, it returns <add>// the number of CPUs which are currently online. On other platforms, <add>// it's the equivalent of [runtime.NumCPU]. <ide> func NumCPU() int { <add> if ncpu := numCPU(); ncpu > 0 { <add> return ncpu <add> } <ide> return runtime.NumCPU() <ide> } <ide><path>pkg/sysinfo/numcpu_linux.go <ide> package sysinfo // import "github.com/docker/docker/pkg/sysinfo" <ide> <ide> import ( <del> "runtime" <del> <ide> "golang.org/x/sys/unix" <ide> ) <ide> <ide> func numCPU() int { <ide> <ide> return mask.Count() <ide> } <del> <del>// NumCPU returns the number of CPUs which are currently online <del>func NumCPU() int { <del> if ncpu := numCPU(); ncpu > 0 { <del> return ncpu <del> } <del> return runtime.NumCPU() <del>} <ide><path>pkg/sysinfo/numcpu_other.go <add>//go:build !linux && !windows <add>// +build !linux,!windows <add> <add>package sysinfo <add> <add>func numCPU() int { <add> // not implemented <add> return 0 <add>} <ide><path>pkg/sysinfo/numcpu_windows.go <ide> package sysinfo // import "github.com/docker/docker/pkg/sysinfo" <ide> <ide> import ( <del> "runtime" <ide> "unsafe" <ide> <ide> "golang.org/x/sys/windows" <ide> func numCPU() int { <ide> ncpu := int(popcnt(uint64(mask))) <ide> return ncpu <ide> } <del> <del>// NumCPU returns the number of CPUs which are currently online <del>func NumCPU() int { <del> if ncpu := numCPU(); ncpu > 0 { <del> return ncpu <del> } <del> return runtime.NumCPU() <del>}
4
Python
Python
add __pos__ to ndarrayoperatorsmixin
e799be5f6a1bb2e0a294a1b0f03a1dc5333f529b
<ide><path>numpy/lib/mixins.py <ide> class NDArrayOperatorsMixin(object): <ide> implement. <ide> <ide> This class does not yet implement the special operators corresponding <del> to ``divmod``, unary ``+`` or ``matmul`` (``@``), because these operation <del> do not yet have corresponding NumPy ufuncs. <add> to ``divmod`` or ``matmul`` (``@``), because these operation do not yet <add> have corresponding NumPy ufuncs. <ide> <ide> It is useful for writing classes that do not inherit from `numpy.ndarray`, <ide> but that should support arithmetic and numpy universal functions like <ide> def __repr__(self): <ide> <ide> # unary methods <ide> __neg__ = _unary_method(um.negative, 'neg') <add> __pos__ = _unary_method(um.positive, 'pos') <ide> __abs__ = _unary_method(um.absolute, 'abs') <ide> __invert__ = _unary_method(um.invert, 'invert') <ide><path>numpy/lib/tests/test_mixins.py <ide> def test_unary_methods(self): <ide> array = np.array([-1, 0, 1, 2]) <ide> array_like = ArrayLike(array) <ide> for op in [operator.neg, <del> # pos is not yet implemented <add> operator.pos, <ide> abs, <ide> operator.invert]: <ide> _assert_equal_type_and_value(op(array_like), ArrayLike(op(array)))
2
Text
Text
fix family default value in socket.connect
fd23c122631a83ea9b4cf069fb78dfb212ecb742
<ide><path>doc/api/net.md <ide> For TCP connections, available `options` are: <ide> * `host` {string} Host the socket should connect to. **Default:** `'localhost'`. <ide> * `localAddress` {string} Local address the socket should connect from. <ide> * `localPort` {number} Local port the socket should connect from. <del>* `family` {number}: Version of IP stack, can be either `4` or `6`. <del> **Default:** `4`. <add>* `family` {number}: Version of IP stack. Must be `4`, `6`, or `0`. <add> **Default:** `0`. <ide> * `hints` {number} Optional [`dns.lookup()` hints][]. <ide> * `lookup` {Function} Custom lookup function. **Default:** [`dns.lookup()`][]. <ide>
1
Text
Text
update devops docs
7e0605ce2b447ebb5790bc52fc159913afbf07e2
<ide><path>docs/devops.md <ide> It is identical to our live production environment at `freeCodeCamp.org`, other <ide> <ide> Once the developer team [`@freeCodeCamp/dev-team`](https://github.com/orgs/freeCodeCamp/teams/dev-team/members) is happy with the changes on the staging application, these changes are moved every few days to the [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-current) branch. <ide> <del>This is the final release that moves changes to our production platforms on freeCodeCamp.org <add>This is the final release that moves changes to our production platforms on freeCodeCamp.org. <ide> <ide> ### Testing changes - Integration and User Acceptance Testing. <ide> <ide> You can take a look and browse these here: <ide> The build pipeline triggers the release pipeline after a hold of 5 minutes for our staff to go in and intervene if necessary. <ide> The code/config is publicly accessible on Azure's Dev Dashboard. Write access to this is limited to the freeCodeCamp.org staff team. <ide> <del>We recommend not pushing more than 3-4 builds to the development (`dot-dev-*`) pipelines within a day and not more than one within the hour. This is because our artifacts are quite large and would put a load on our servers when deploying. <add>We recommend not pushing more than 3-4 builds to the pipelines within a day and not more than one within the hour. This is because our artifacts are quite large and would put a load on our servers when deploying. <ide> <ide> ## Triggering a build, test and deployment. <ide>
1
Javascript
Javascript
fix deltatime calculation
5840a9051d7a4e492e889d7162ae85d74b3c92d1
<ide><path>Libraries/Lists/VirtualizedList.js <ide> class VirtualizedList extends React.PureComponent<OptionalProps, Props, State> { <ide> const visibleLength = this._selectLength(e.nativeEvent.layoutMeasurement); <ide> const contentLength = this._selectLength(e.nativeEvent.contentSize); <ide> const offset = this._selectOffset(e.nativeEvent.contentOffset); <del> const dt = Math.max(1, timestamp - this._scrollMetrics.timestamp); <add> const dt = this._scrollMetrics.timestamp <add> ? Math.max(1, timestamp - this._scrollMetrics.timestamp) <add> : 1; <ide> if (dt > 500 && this._scrollMetrics.dt > 500 && (contentLength > (5 * visibleLength)) && <ide> !this._hasWarned.perf) { <ide> infoLog(
1
Go
Go
use golint to check package util
17ce34116af4e8c6b66d0c7906efcae2fd75efc6
<ide><path>utils/experimental.go <ide> <ide> package utils <ide> <add>// ExperimentalBuild is a stub which always returns true for <add>// builds that include the "experimental" build tag <ide> func ExperimentalBuild() bool { <ide> return true <ide> } <ide><path>utils/git.go <ide> import ( <ide> "github.com/docker/docker/pkg/urlutil" <ide> ) <ide> <add>// GitClone clones a repository into a newly created directory which <add>// will be under "docker-build-git" <ide> func GitClone(remoteURL string) (string, error) { <ide> if !urlutil.IsGitTransport(remoteURL) { <ide> remoteURL = "https://" + remoteURL <ide><path>utils/stubs.go <ide> <ide> package utils <ide> <add>// ExperimentalBuild is a stub which always returns false for <add>// builds that do not include the "experimental" build tag <ide> func ExperimentalBuild() bool { <ide> return false <ide> } <ide><path>utils/utils.go <ide> import ( <ide> "github.com/docker/docker/pkg/stringid" <ide> ) <ide> <del>// Figure out the absolute path of our own binary (if it's still around). <add>// SelfPath figures out the absolute path of our own binary (if it's still around). <ide> func SelfPath() string { <ide> path, err := exec.LookPath(os.Args[0]) <ide> if err != nil { <ide> func isValidDockerInitPath(target string, selfPath string) bool { // target and <ide> return dockerversion.INITSHA1 != "" && dockerInitSha1(target) == dockerversion.INITSHA1 <ide> } <ide> <del>// Figure out the path of our dockerinit (which may be SelfPath()) <add>// DockerInitPath figures out the path of our dockerinit (which may be SelfPath()) <ide> func DockerInitPath(localCopy string) string { <ide> selfPath := SelfPath() <ide> if isValidDockerInitPath(selfPath, selfPath) { <ide> func GetCallerName(depth int) string { <ide> return callerShortName <ide> } <ide> <del>// ReplaceOrAppendValues returns the defaults with the overrides either <add>// ReplaceOrAppendEnvValues returns the defaults with the overrides either <ide> // replaced by env key or appended to the list <ide> func ReplaceOrAppendEnvValues(defaults, overrides []string) []string { <ide> cache := make(map[string]int, len(defaults)) <ide> func ValidateContextDirectory(srcPath string, excludes []string) error { <ide> }) <ide> } <ide> <del>// Reads a .dockerignore file and returns the list of file patterns <add>// ReadDockerIgnore reads a .dockerignore file and returns the list of file patterns <ide> // to ignore. Note this will trim whitespace from each line as well <ide> // as use GO's "clean" func to get the shortest/cleanest path for each. <ide> func ReadDockerIgnore(path string) ([]string, error) {
4
Javascript
Javascript
improve assert message in http timeout test
36696cfe8479f3fd511124b60c24b4a6a33a80da
<ide><path>test/parallel/test-http-client-timeout-option-with-agent.js <ide> function doRequest() { <ide> const duration = Date.now() - start; <ide> // The timeout event cannot be precisely timed. It will delay <ide> // some number of milliseconds. <del> assert.ok(duration >= HTTP_CLIENT_TIMEOUT, <del> `${duration} < ${HTTP_CLIENT_TIMEOUT}`); <add> assert.ok( <add> duration >= HTTP_CLIENT_TIMEOUT, <add> `duration ${duration}ms less than timeout ${HTTP_CLIENT_TIMEOUT}ms` <add> ); <ide> })); <ide> req.end(); <ide>
1
Mixed
Javascript
fix nvc for rcttextinlineimage
0343e697fdbb3411e316a053264e670d31058f8e
<ide><path>Libraries/Image/Image.android.js <ide> let Image = (props: ImagePropsType, forwardedRef) => { <ide> : nativeProps; <ide> return ( <ide> <TextAncestor.Consumer> <del> {hasTextAncestor => <del> hasTextAncestor ? ( <del> <TextInlineImageNativeComponent {...nativePropsWithAnalytics} /> <del> ) : ( <del> <ImageViewNativeComponent {...nativePropsWithAnalytics} /> <del> ) <del> } <add> {hasTextAncestor => { <add> if (hasTextAncestor) { <add> let src = Array.isArray(sources) ? sources : [sources]; <add> return ( <add> <TextInlineImageNativeComponent <add> style={style} <add> resizeMode={props.resizeMode} <add> headers={nativeProps.headers} <add> src={src} <add> ref={forwardedRef} <add> /> <add> ); <add> } <add> <add> return <ImageViewNativeComponent {...nativePropsWithAnalytics} />; <add> }} <ide> </TextAncestor.Consumer> <ide> ); <ide> }} <ide><path>Libraries/Image/ImageViewNativeComponent.js <ide> type Props = $ReadOnly<{ <ide> // Android native props <ide> shouldNotifyLoadEvents?: boolean, <ide> src?: ?ResolvedAssetSource | $ReadOnlyArray<{uri: string, ...}>, <del> headers?: ?string, <add> headers?: ?{[string]: string}, <ide> defaultSrc?: ?string, <ide> loadingIndicatorSrc?: ?string, <ide> }>; <ide><path>Libraries/Image/TextInlineImageNativeComponent.js <ide> <ide> 'use strict'; <ide> <del>import type {ResolvedAssetSource} from './AssetSourceResolver'; <ide> import type {HostComponent} from '../Renderer/shims/ReactNativeTypes'; <del>import type {ImageProps} from './ImageProps'; <ide> import type {ViewProps} from '../Components/View/ViewPropTypes'; <add>import type {ImageResizeMode} from './ImageResizeMode'; <ide> import * as NativeComponentRegistry from '../NativeComponent/NativeComponentRegistry'; <del>import type { <del> ColorValue, <del> DangerouslyImpreciseStyle, <del> ImageStyleProp, <del>} from '../StyleSheet/StyleSheet'; <add>import type {ColorValue} from '../StyleSheet/StyleSheet'; <ide> <del>type Props = $ReadOnly<{ <del> ...ImageProps, <add>type NativeProps = $ReadOnly<{ <ide> ...ViewProps, <del> <del> style?: ImageStyleProp | DangerouslyImpreciseStyle, <del> <del> // iOS native props <del> tintColor?: ColorValue, <del> <del> // Android native props <del> shouldNotifyLoadEvents?: boolean, <del> src?: ?ResolvedAssetSource | $ReadOnlyArray<{uri: string, ...}>, <del> headers?: ?string, <del> defaultSrc?: ?string, <del> loadingIndicatorSrc?: ?string, <del> internal_analyticTag?: ?string, <add> resizeMode?: ?ImageResizeMode, <add> src?: ?$ReadOnlyArray<?$ReadOnly<{uri: string, ...}>>, <add> tintColor?: ?ColorValue, <add> headers?: ?{[string]: string}, <ide> }>; <ide> <del>const TextInlineImage: HostComponent<Props> = <del> NativeComponentRegistry.get<Props>('RCTTextInlineImage', () => ({ <add>const TextInlineImage: HostComponent<NativeProps> = <add> NativeComponentRegistry.get<NativeProps>('RCTTextInlineImage', () => ({ <ide> uiViewClassName: 'RCTTextInlineImage', <ide> bubblingEventTypes: {}, <del> directEventTypes: { <del> topLoadStart: { <del> registrationName: 'onLoadStart', <del> }, <del> topProgress: { <del> registrationName: 'onProgress', <del> }, <del> topError: { <del> registrationName: 'onError', <del> }, <del> topPartialLoad: { <del> registrationName: 'onPartialLoad', <del> }, <del> topLoad: { <del> registrationName: 'onLoad', <del> }, <del> topLoadEnd: { <del> registrationName: 'onLoadEnd', <del> }, <del> }, <add> directEventTypes: {}, <ide> validAttributes: { <del> blurRadius: true, <del> capInsets: { <del> diff: require('../Utilities/differ/insetsDiffer'), <del> }, <del> defaultSource: { <del> process: require('./resolveAssetSource'), <del> }, <del> defaultSrc: true, <del> fadeDuration: true, <del> headers: true, <del> internal_analyticTag: true, <del> loadingIndicatorSrc: true, <del> onError: true, <del> onLoad: true, <del> onLoadEnd: true, <del> onLoadStart: true, <del> onPartialLoad: true, <del> onProgress: true, <del> overlayColor: { <del> process: require('../StyleSheet/processColor'), <del> }, <del> progressiveRenderingEnabled: true, <del> resizeMethod: true, <ide> resizeMode: true, <del> shouldNotifyLoadEvents: true, <del> source: true, <ide> src: true, <ide> tintColor: { <ide> process: require('../StyleSheet/processColor'), <ide> }, <add> headers: true, <ide> }, <ide> })); <ide> <ide><path>ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode.java <ide> public void setHeaders(ReadableMap headers) { <ide> mHeaders = headers; <ide> } <ide> <del> @ReactProp(name = "tintColor") <add> @ReactProp(name = "tintColor", customType = "Color") <ide> public void setTintColor(int tintColor) { <ide> mTintColor = tintColor; <ide> } <ide><path>ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager.java <ide> import com.facebook.drawee.backends.pipeline.Fresco; <ide> import com.facebook.drawee.controller.AbstractDraweeControllerBuilder; <ide> import com.facebook.react.module.annotations.ReactModule; <add>import com.facebook.react.uimanager.BaseViewManager; <ide> import com.facebook.react.uimanager.ThemedReactContext; <del>import com.facebook.react.uimanager.ViewManager; <ide> <ide> /** <ide> * Manages Images embedded in Text nodes using Fresco. Since they are used only as a virtual nodes <ide> * any type of native view operation will throw an {@link IllegalStateException}. <ide> */ <ide> @ReactModule(name = FrescoBasedReactTextInlineImageViewManager.REACT_CLASS) <ide> public class FrescoBasedReactTextInlineImageViewManager <del> extends ViewManager<View, FrescoBasedReactTextInlineImageShadowNode> { <add> extends BaseViewManager<View, FrescoBasedReactTextInlineImageShadowNode> { <ide> <ide> public static final String REACT_CLASS = "RCTTextInlineImage"; <ide>
5
Ruby
Ruby
move schema cache from connection to pool
49b6b211a922f73d0b083e7e4d2f0a91bd44da90
<ide><path>activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb <ide> class ExclusiveConnectionTimeoutError < ConnectionTimeoutError <ide> end <ide> <ide> module ConnectionAdapters <add> module AbstractPool # :nodoc: <add> def get_schema_cache(connection) <add> @schema_cache ||= SchemaCache.new(connection) <add> @schema_cache.connection = connection <add> @schema_cache <add> end <add> <add> def set_schema_cache(cache) <add> @schema_cache = cache <add> end <add> end <add> <add> class NullPool # :nodoc: <add> include ConnectionAdapters::AbstractPool <add> <add> def initialize <add> @schema_cache = nil <add> end <add> end <add> <ide> # Connection pool base class for managing Active Record database <ide> # connections. <ide> # <ide> def run <ide> <ide> include MonitorMixin <ide> include QueryCache::ConnectionPoolConfiguration <add> include ConnectionAdapters::AbstractPool <ide> <ide> attr_accessor :automatic_reconnect, :checkout_timeout, :schema_cache <ide> attr_reader :spec, :connections, :size, :reaper <ide> def remove_connection_from_thread_cache(conn, owner_thread = conn.owner) <ide> <ide> def new_connection <ide> Base.send(spec.adapter_method, spec.config).tap do |conn| <del> conn.schema_cache = schema_cache.dup if schema_cache <ide> conn.check_version <ide> end <ide> end <ide><path>activerecord/lib/active_record/connection_adapters/abstract_adapter.rb <ide> class AbstractAdapter <ide> SIMPLE_INT = /\A\d+\z/ <ide> <ide> attr_accessor :pool <del> attr_reader :schema_cache, :visitor, :owner, :logger, :lock, :prepared_statements, :prevent_writes <add> attr_reader :visitor, :owner, :logger, :lock, :prepared_statements, :prevent_writes <ide> alias :in_use? :owner <ide> <ide> set_callback :checkin, :after, :enable_lazy_transactions! <ide> def initialize(connection, logger = nil, config = {}) # :nodoc: <ide> @instrumenter = ActiveSupport::Notifications.instrumenter <ide> @logger = logger <ide> @config = config <del> @pool = nil <add> @pool = ActiveRecord::ConnectionAdapters::NullPool.new <ide> @idle_since = Concurrent.monotonic_time <del> @schema_cache = SchemaCache.new self <ide> @quoted_column_names, @quoted_table_names = {}, {} <ide> @prevent_writes = false <ide> @visitor = arel_visitor <ide> def lease <ide> @owner = Thread.current <ide> end <ide> <add> def schema_cache <add> @pool.get_schema_cache(self) <add> end <add> <ide> def schema_cache=(cache) <ide> cache.connection = self <del> @schema_cache = cache <add> @pool.set_schema_cache(cache) <ide> end <ide> <ide> # this method must only be called while holding connection pool's mutex <ide> def discard! <ide> # <ide> # Prevent @connection's finalizer from touching the socket, or <ide> # otherwise communicating with its server, when it is collected. <add> if schema_cache.connection == self <add> schema_cache.connection = nil <add> end <ide> end <ide> <ide> # Reset the state of this connection, directing the DBMS to clear <ide><path>activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb <ide> def disconnect! <ide> end <ide> <ide> def discard! # :nodoc: <add> super <ide> @connection.automatic_close = false <ide> @connection = nil <ide> end <ide><path>activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb <ide> def disconnect! <ide> end <ide> <ide> def discard! # :nodoc: <add> super <ide> @connection.socket_io.reopen(IO::NULL) rescue nil <ide> @connection = nil <ide> end <ide><path>activerecord/lib/active_record/railtie.rb <ide> class Railtie < Rails::Railtie # :nodoc: <ide> <ide> cache = YAML.load(File.read(filename)) <ide> if cache.version == current_version <del> connection.schema_cache = cache <ide> connection_pool.schema_cache = cache.dup <ide> else <ide> warn "Ignoring db/schema_cache.yml because it has expired. The current schema version is #{current_version}, but the one in the cache is #{cache.version}." <ide><path>activerecord/test/cases/connection_pool_test.rb <ide> def test_pool_sets_connection_schema_cache <ide> pool.schema_cache = schema_cache <ide> <ide> pool.with_connection do |conn| <del> assert_not_same pool.schema_cache, conn.schema_cache <ide> assert_equal pool.schema_cache.size, conn.schema_cache.size <ide> assert_same pool.schema_cache.columns(:posts), conn.schema_cache.columns(:posts) <ide> end
6
Text
Text
fix sample command
f37c00279bd50d2aac38e3e2b67f6ab1826ef777
<ide><path>examples/cms-strapi/README.md <ide> Inside the Strapi directory, stop the server, [install GraphQL](https://strapi.i <ide> # If using Yarn: yarn strapi install graphql <ide> npm run strapi install graphql <ide> <del>npm run dev # or: yarn develop <add>npm run develop # or: yarn develop <ide> ``` <ide> <ide> ### Step 3. Create an `Author` collection
1
Javascript
Javascript
fix coding style in src/core/font_renderer.js
75de115938ed7fb0b7d6b2da12a09dd38ca412ed
<ide><path>src/core/font_renderer.js <ide> var FontRendererFactory = (function FontRendererFactoryClosure() { <ide> } <ide> <ide> function parseCmap(data, start, end) { <del> var offset = getUshort(data, start + 2) === 1 ? getLong(data, start + 8) : <del> getLong(data, start + 16); <add> var offset = (getUshort(data, start + 2) === 1 ? <add> getLong(data, start + 8) : getLong(data, start + 16)); <ide> var format = getUshort(data, start + offset); <ide> if (format === 4) { <ide> var length = getUshort(data, start + offset + 2); <ide> var FontRendererFactory = (function FontRendererFactoryClosure() { <ide> <ide> function parseCff(data, start, end) { <ide> var properties = {}; <del> var parser = new CFFParser( <del> new Stream(data, start, end - start), properties); <add> var parser = new CFFParser(new Stream(data, start, end - start), <add> properties); <ide> var cff = parser.parse(); <ide> return { <ide> glyphs: cff.charStrings.objects, <del> subrs: cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && <del> cff.topDict.privateDict.subrsIndex.objects, <add> subrs: (cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && <add> cff.topDict.privateDict.subrsIndex.objects), <ide> gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects <ide> }; <ide> } <ide> var FontRendererFactory = (function FontRendererFactoryClosure() { <ide> var xa = x + stack.shift(), ya = y + stack.shift(); <ide> var xb = xa + stack.shift(), yb = ya + stack.shift(); <ide> x = xb; y = yb; <del> if (Math.abs(x - x0) > Math.abs(y - y0)) <add> if (Math.abs(x - x0) > Math.abs(y - y0)) { <ide> x += stack.shift(); <del> else <add> } else { <ide> y += stack.shift(); <add> } <ide> bezierCurveTo(xa, ya, xb, yb, x, y); <ide> break; <ide> default: <ide> var FontRendererFactory = (function FontRendererFactoryClosure() { <ide> } <ide> break; <ide> default: <del> if (v < 32) <add> if (v < 32) { <ide> error('unknown operator: ' + v); <del> if (v < 247) <add> } <add> if (v < 247) { <ide> stack.push(v - 139); <del> else if (v < 251) <add> } else if (v < 251) { <ide> stack.push((v - 247) * 256 + code[i++] + 108); <del> else if (v < 255) <add> } else if (v < 255) { <ide> stack.push(-(v - 251) * 256 - code[i++] - 108); <del> else { <add> } else { <ide> stack.push(((code[i] << 24) | (code[i + 1] << 16) | <ide> (code[i + 2] << 8) | code[i + 3]) / 65536); <ide> i += 4; <ide> var FontRendererFactory = (function FontRendererFactoryClosure() { <ide> this.glyphNameMap = glyphNameMap || GlyphsUnicode; <ide> <ide> this.compiledGlyphs = []; <del> this.gsubrsBias = this.gsubrs.length < 1240 ? 107 : <del> this.gsubrs.length < 33900 ? 1131 : 32768; <del> this.subrsBias = this.subrs.length < 1240 ? 107 : <del> this.subrs.length < 33900 ? 1131 : 32768; <add> this.gsubrsBias = (this.gsubrs.length < 1240 ? <add> 107 : (this.gsubrs.length < 33900 ? 1131 : 32768)); <add> this.subrsBias = (this.subrs.length < 1240 ? <add> 107 : (this.subrs.length < 33900 ? 1131 : 32768)); <ide> } <ide> <ide> Util.inherit(Type2Compiled, CompiledFont, { <ide> var FontRendererFactory = (function FontRendererFactoryClosure() { <ide> } <ide> <ide> if (glyf) { <del> var fontMatrix = !unitsPerEm ? font.fontMatrix : <del> [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]; <add> var fontMatrix = (!unitsPerEm ? font.fontMatrix : <add> [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]); <ide> return new TrueTypeCompiled( <ide> parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); <ide> } else {
1
Mixed
Text
add changelog entry for
15331a2ac4113673d4948eda03e33d0d11d9f335
<ide><path>actionpack/CHANGELOG.md <add>* Add method `dig` to `session`. <add> <add> *claudiob*, *Takumi Shotoku* <add> <ide> * Controller level `force_ssl` has been deprecated in favor of <ide> `config.force_ssl`. <ide> <ide><path>actionpack/lib/action_dispatch/request/session.rb <ide> def [](key) <ide> @delegate[key.to_s] <ide> end <ide> <del> # Returns the nested value specified by the sequence of key, returning <del> # nil if any intermediate step is nil. <add> # Returns the nested value specified by the sequence of keys, returning <add> # +nil+ if any intermediate step is +nil+. <ide> def dig(*keys) <ide> load_for_read! <ide> keys = keys.map.with_index { |key, i| i.zero? ? key.to_s : key }
2
Javascript
Javascript
remove unused code from broken shaderskin.js
0287cab597c854f48b859cbf7eeb5f8b995d6314
<ide><path>examples/js/ShaderSkin.js <ide> THREE.ShaderSkin = { <ide> "#if MAX_POINT_LIGHTS > 0", <ide> <ide> "for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {", <del> <add> <ide> "vec3 pointVector = normalize( pointLights[ i ].direction );", <add> "float attenuation = calcLightAttenuation( length( lVector ), pointLights[ i ].distance, pointLights[ i ].decay );", <ide> <ide> "float pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );", <del> <del> "float attenuation = calcLightAttenuation( length( lVector ), pointLights[ i ].distance, pointLights[ i ].decay );", <ide> <ide> "totalDiffuseLight += pointLightColor[ i ] * ( pointDiffuseWeight * attenuation );", <ide> <ide> THREE.ShaderSkin = { <ide> "varying vec3 vViewPosition;", <ide> <ide> THREE.ShaderChunk[ "common" ], <del> THREE.ShaderChunk[ "lights" ], <ide> <ide> "void main() {", <ide> <ide> THREE.ShaderSkin = { <ide> <ide> "vUv = uv;", <ide> <del> // point lights <del> <del> "#if MAX_POINT_LIGHTS > 0", <del> <del> "for( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {", <del> <del> "vec3 lVector = pointLights[ i ].position - vViewPosition;", <del> <del> "float attenuation = calcLightAttenuation( length( lVector ), pointLights[ i ].distance, pointLights[ i ].decay );", <del> <del> "lVector = normalize( lVector );", <del> <del> "vPointLight[ i ] = vec4( lVector, attenuation );", <del> <del> "}", <del> <del> "#endif", <del> <ide> // displacement mapping <ide> <ide> "#ifdef VERTEX_TEXTURES", <ide> THREE.ShaderSkin = { <ide> "varying vec3 vViewPosition;", <ide> <ide> THREE.ShaderChunk[ "common" ], <del> THREE.ShaderChunk[ "lights" ], <ide> <ide> "void main() {", <ide> <ide> THREE.ShaderSkin = { <ide> <ide> "vUv = uv;", <ide> <del> // point lights <del> <del> "#if MAX_POINT_LIGHTS > 0", <del> <del> "for( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {", <del> <del> "vec3 lVector = pointLights[ i ].position - vViewPosition;", <del> <del> "float attenuation = calcLightAttenuation( length( lVector ), pointLights[ i ].distance, pointLights[ i ].decay );", <del> <del> "lVector = normalize( lVector );", <del> <del> "vPointLight[ i ] = vec4( lVector, attenuation );", <del> <del> "}", <del> <del> "#endif", <del> <ide> "gl_Position = vec4( uv.x * 2.0 - 1.0, uv.y * 2.0 - 1.0, 0.0, 1.0 );", <ide> <ide> "}"
1
Javascript
Javascript
fix jsdoc documentations
b9c50fdb090cac8def50e576676463c739bd3046
<ide><path>lib/BannerPlugin.js <ide> class BannerPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/Chunk.js <ide> const ChunkFilesSet = createArrayToSetDeprecationSet("chunk.files"); <ide> * @property {Record<string|number, string>} name <ide> */ <ide> <del>/** <del> * Compare two Modules based on their ids for sorting <del> * @param {Module} a module <del> * @param {Module} b module <del> * @returns {-1|0|1} sort value <del> */ <del> <ide> let debugId = 1000; <ide> <ide> /** <ide><path>lib/ConstPlugin.js <ide> const getHoistedDeclarations = (branch, includeFunctionDeclarations) => { <ide> <ide> class ConstPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/DefinePlugin.js <ide> class DefinePlugin { <ide> <ide> /** <ide> * Apply the plugin <del> * @param {Compiler} compiler webpack compiler <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/DllPlugin.js <ide> class DllPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/DynamicEntryPlugin.js <ide> class DynamicEntryPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/EntryPlugin.js <ide> class EntryPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/EnvironmentPlugin.js <ide> class EnvironmentPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler instance <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/EvalDevToolModulePlugin.js <ide> class EvalDevToolModulePlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/EvalSourceMapDevToolPlugin.js <ide> class EvalSourceMapDevToolPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/ExportsInfoApiPlugin.js <ide> const ExportsInfoDependency = require("./dependencies/ExportsInfoDependency"); <ide> <ide> class ExportsInfoApiPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/ExternalsPlugin.js <ide> class ExternalsPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/FileSystemInfo.js <ide> const INVALID = Symbol("invalid"); <ide> * @property {Set<string>} resolveDependencies.missing list of missing entries <ide> */ <ide> <add>/* istanbul ignore next */ <ide> /** <del> * istanbul ignore next <ide> * @param {number} mtime mtime <ide> */ <ide> const applyMtime = mtime => { <ide><path>lib/FlagAllModulesAsUsedPlugin.js <ide> class FlagAllModulesAsUsedPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/FlagDependencyExportsPlugin.js <ide> const getCacheIdentifier = (compilation, module) => { <ide> <ide> class FlagDependencyExportsPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/FlagDependencyUsagePlugin.js <ide> const Queue = require("./util/Queue"); <ide> <ide> class FlagDependencyUsagePlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/FlagEntryExportAsUsedPlugin.js <ide> class FlagEntryExportAsUsedPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/FlagUsingEvalPlugin.js <ide> const InnerGraph = require("./optimize/InnerGraph"); <ide> <ide> class FlagUsingEvalPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/HotModuleReplacementPlugin.js <ide> class HotModuleReplacementPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/IgnorePlugin.js <ide> class IgnorePlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/LibManifestPlugin.js <ide> class LibManifestPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/LibraryTemplatePlugin.js <ide> class LibraryTemplatePlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/LoaderOptionsPlugin.js <ide> class LoaderOptionsPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/LoaderTargetPlugin.js <ide> class LoaderTargetPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/ProvidePlugin.js <ide> class ProvidePlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/SourceMapDevToolPlugin.js <ide> class SourceMapDevToolPlugin { <ide> } <ide> <ide> /** <del> * Apply compiler <add> * Apply the plugin <ide> * @param {Compiler} compiler compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/UseStrictPlugin.js <ide> const ConstDependency = require("./dependencies/ConstDependency"); <ide> <ide> class UseStrictPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/WatchIgnorePlugin.js <ide> class WatchIgnorePlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/asset/AssetModulesPlugin.js <ide> const plugin = "AssetModulesPlugin"; <ide> <ide> class AssetModulesPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/async-modules/InferAsyncModulesPlugin.js <ide> class InferAsyncModulesPlugin { <ide> this.errorOnImport = errorOnImport; <ide> } <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/cache/AddBuildDependenciesPlugin.js <ide> class AddBuildDependenciesPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/cache/AddManagedPathsPlugin.js <ide> class AddManagedPathsPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/cache/IdleFileCachePlugin.js <ide> class IdleFileCachePlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/cache/MemoryCachePlugin.js <ide> const Cache = require("../Cache"); <ide> <ide> class MemoryCachePlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/cache/ResolverCachePlugin.js <ide> const objectToString = (object, excludeContext) => { <ide> <ide> class ResolverCachePlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/dependencies/AMDPlugin.js <ide> class AMDPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/dependencies/HarmonyModulesPlugin.js <ide> class HarmonyModulesPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/ids/ChunkModuleIdRangePlugin.js <ide> class ChunkModuleIdRangePlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/ids/DeterministicChunkIdsPlugin.js <ide> class DeterministicChunkIdsPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/ids/DeterministicModuleIdsPlugin.js <ide> class DeterministicModuleIdsPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/ids/NamedChunkIdsPlugin.js <ide> class NamedChunkIdsPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/ids/NamedModuleIdsPlugin.js <ide> class NamedModuleIdsPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/ids/NaturalChunkIdsPlugin.js <ide> const { assignAscendingChunkIds } = require("./IdHelpers"); <ide> <ide> class NaturalChunkIdsPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/ids/NaturalModuleIdsPlugin.js <ide> const { assignAscendingModuleIds } = require("./IdHelpers"); <ide> <ide> class NaturalModuleIdsPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/ids/OccurrenceChunkIdsPlugin.js <ide> class OccurrenceChunkIdsPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/ids/OccurrenceModuleIdsPlugin.js <ide> class OccurrenceModuleIdsPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/javascript/JavascriptModulesPlugin.js <ide> class JavascriptModulesPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/library/AbstractLibraryPlugin.js <ide> class AbstractLibraryPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/library/EnableLibraryPlugin.js <ide> class EnableLibraryPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/node/NodeEnvironmentPlugin.js <ide> class NodeEnvironmentPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/node/NodeSourcePlugin.js <ide> module.exports = class NodeSourcePlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/node/NodeTargetPlugin.js <ide> const builtins = <ide> <ide> class NodeTargetPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/node/NodeTemplatePlugin.js <ide> class NodeTemplatePlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/node/ReadFileCompileAsyncWasmPlugin.js <ide> const AsyncWasmChunkLoadingRuntimeModule = require("../wasm-async/AsyncWasmChunk <ide> <ide> class ReadFileCompileAsyncWasmPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/node/ReadFileCompileWasmPlugin.js <ide> class ReadFileCompileWasmPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/optimize/AggressiveMergingPlugin.js <ide> class AggressiveMergingPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/optimize/AggressiveSplittingPlugin.js <ide> class AggressiveSplittingPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/optimize/EnsureChunkConditionsPlugin.js <ide> const { STAGE_BASIC } = require("../OptimizationStages"); <ide> <ide> class EnsureChunkConditionsPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/optimize/FlagIncludedChunksPlugin.js <ide> <ide> class FlagIncludedChunksPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/optimize/InnerGraphPlugin.js <ide> const isPure = (expr, parser, commentsStartPos) => { <ide> <ide> class InnerGraphPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/optimize/MangleExportsPlugin.js <ide> const mangleExportsInfo = (exportsInfo, canBeArray) => { <ide> <ide> class MangleExportsPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/optimize/MinChunkSizePlugin.js <ide> class MinChunkSizePlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/optimize/ModuleConcatenationPlugin.js <ide> class ModuleConcatenationPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/optimize/RemoveEmptyChunksPlugin.js <ide> const { STAGE_BASIC, STAGE_ADVANCED } = require("../OptimizationStages"); <ide> <ide> class RemoveEmptyChunksPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/optimize/RuntimeChunkPlugin.js <ide> class RuntimeChunkPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/optimize/SideEffectsFlagPlugin.js <ide> const globToRegexp = (glob, cache) => { <ide> <ide> class SideEffectsFlagPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/optimize/SplitChunksPlugin.js <ide> module.exports = class SplitChunksPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/performance/SizeLimitsPlugin.js <ide> module.exports = class SizeLimitsPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/runtime/StartupChunkDependenciesPlugin.js <ide> class StartupChunkDependenciesPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/stats/DefaultStatsFactoryPlugin.js <ide> const MERGER = { <ide> <ide> class DefaultStatsFactoryPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/stats/DefaultStatsPresetPlugin.js <ide> const NORMALIZER = { <ide> <ide> class DefaultStatsPresetPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/stats/DefaultStatsPrinterPlugin.js <ide> const table = (array, align, splitter) => { <ide> <ide> class DefaultStatsPrinterPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/util/AsyncQueue.js <ide> let inHandleResult = 0; <ide> <ide> /** <ide> * @template T <del> * @callback Callback<T> <add> * @callback Callback <ide> * @param {Error=} err <ide> * @param {T=} result <ide> */ <ide><path>lib/wasm-async/AsyncWebAssemblyModulesPlugin.js <ide> class AsyncWebAssemblyModulesPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/wasm/WasmFinalizeExportsPlugin.js <ide> const UnsupportedWebAssemblyFeatureError = require("./UnsupportedWebAssemblyFeat <ide> <ide> class WasmFinalizeExportsPlugin { <ide> /** <del> * @param {Compiler} compiler webpack compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/wasm/WebAssemblyModulesPlugin.js <ide> class WebAssemblyModulesPlugin { <ide> } <ide> <ide> /** <del> * @param {Compiler} compiler compiler <add> * Apply the plugin <add> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide> apply(compiler) { <ide><path>lib/web/FetchCompileAsyncWasmPlugin.js <ide> const AsyncWasmChunkLoadingRuntimeModule = require("../wasm-async/AsyncWasmChunk <ide> <ide> class FetchCompileAsyncWasmPlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/web/FetchCompileWasmPlugin.js <ide> class FetchCompileWasmPlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/web/JsonpTemplatePlugin.js <ide> class JsonpTemplatePlugin { <ide> } <ide> <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */ <ide><path>lib/webworker/WebWorkerTemplatePlugin.js <ide> const ImportScriptsChunkLoadingRuntimeModule = require("./ImportScriptsChunkLoad <ide> <ide> class WebWorkerTemplatePlugin { <ide> /** <add> * Apply the plugin <ide> * @param {Compiler} compiler the compiler instance <ide> * @returns {void} <ide> */
80
PHP
PHP
fix bug in listing method
36ff7b81aa351b336c1c80083587debca0069583
<ide><path>laravel/html.php <ide> private static function listing($type, $list, $attributes = array()) <ide> { <ide> if (is_array($value)) <ide> { <del> $html .= static::elements($type, $value); <add> $html .= static::listing($type, $value); <ide> } <ide> else <ide> {
1
Ruby
Ruby
exclude executables from metafiles
d4df9d44e09df6197275113b266df2b7d51a0339
<ide><path>Library/Homebrew/keg.rb <ide> def ==(other) <ide> <ide> def empty_installation? <ide> Pathname.glob("#{path}/**/*") do |file| <add> return false if file.executable? <ide> next if file.directory? <ide> basename = file.basename.to_s <ide> next if Metafiles.copy?(basename)
1
Python
Python
add support for raggedtensors to the dense layer
8101f6a7256319c598a0a28c5222ef36ba329453
<ide><path>keras/layers/core.py <ide> def call(self, inputs): <ide> if inputs.dtype.base_dtype != self._compute_dtype_object.base_dtype: <ide> inputs = tf.cast(inputs, dtype=self._compute_dtype_object) <ide> <add> if isinstance(inputs, tf.RaggedTensor) and inputs.shape[-1] is not None: <add> # In case we encounter a RaggedTensor with a fixed last dimension (last <add> # dimension not ragged), we can map the call method to the flat values. <add> return tf.ragged.map_flat_values(self.call, inputs) <add> <ide> rank = inputs.shape.rank <ide> if rank == 2 or rank is None: <ide> # We use embedding_lookup_sparse as a more efficient matmul operation for <ide><path>keras/layers/core_test.py <ide> def test_dropout(self): <ide> <ide> testing_utils.layer_test( <ide> keras.layers.Dropout, <del> kwargs={'rate': 0.5, <del> 'noise_shape': [3, 1]}, <add> kwargs={ <add> 'rate': 0.5, <add> 'noise_shape': [3, 1] <add> }, <ide> input_shape=(3, 2)) <ide> <ide> def test_dropout_supports_masking(self): <ide> def test_spatial_dropout_2d(self): <ide> <ide> testing_utils.layer_test( <ide> keras.layers.SpatialDropout2D, <del> kwargs={'rate': 0.5, 'data_format': 'channels_first'}, <add> kwargs={ <add> 'rate': 0.5, <add> 'data_format': 'channels_first' <add> }, <ide> input_shape=(2, 3, 4, 5)) <ide> <ide> def test_spatial_dropout_3d(self): <ide> def test_spatial_dropout_3d(self): <ide> <ide> testing_utils.layer_test( <ide> keras.layers.SpatialDropout3D, <del> kwargs={'rate': 0.5, 'data_format': 'channels_first'}, <add> kwargs={ <add> 'rate': 0.5, <add> 'data_format': 'channels_first' <add> }, <ide> input_shape=(2, 3, 4, 4, 5)) <ide> <ide> def test_dropout_partial_noise_shape(self): <ide> def f(x): <ide> <ide> ld = keras.layers.Lambda(f) <ide> config = ld.get_config() <del> ld = keras.layers.deserialize({ <del> 'class_name': 'Lambda', <del> 'config': config <del> }) <add> ld = keras.layers.deserialize({'class_name': 'Lambda', 'config': config}) <ide> self.assertEqual(ld.function(3), 4) <ide> <ide> # test with lambda <ide> def test_lambda_output_shape(self): <ide> self.assertEqual((1, 1), l.get_config()['output_shape']) <ide> <ide> def test_lambda_output_shape_function(self): <add> <ide> def get_output_shape(input_shape): <ide> return 1 * input_shape <ide> <ide> def lambda_fn(x): <ide> self.assertAllEqual((10, 20), output_shape) <ide> output_signature = l.compute_output_signature([ <ide> tf.TensorSpec(dtype=tf.float64, shape=(10, 10)), <del> tf.TensorSpec(dtype=tf.float64, shape=(10, 20))]) <add> tf.TensorSpec(dtype=tf.float64, shape=(10, 20)) <add> ]) <ide> self.assertAllEqual((10, 20), output_signature.shape) <ide> self.assertAllEqual(tf.float64, output_signature.dtype) <ide> <ide> def lambda_fn(inputs): <ide> def test_lambda_config_serialization(self): <ide> # Test serialization with output_shape and output_shape_type <ide> layer = keras.layers.Lambda( <del> lambda x: x + 1, <del> output_shape=(1, 1), <del> mask=lambda i, m: m) <add> lambda x: x + 1, output_shape=(1, 1), mask=lambda i, m: m) <ide> layer(keras.backend.variable(np.ones((1, 1)))) <ide> config = layer.get_config() <ide> <del> layer = keras.layers.deserialize({ <del> 'class_name': 'Lambda', <del> 'config': config <del> }) <add> layer = keras.layers.deserialize({'class_name': 'Lambda', 'config': config}) <ide> self.assertAllEqual(layer.function(1), 2) <ide> self.assertAllEqual(layer._output_shape, (1, 1)) <ide> self.assertAllEqual(layer.mask(1, True), True) <ide> def test_lambda_with_ragged_input(self): <ide> <ide> def add_one(inputs): <ide> return inputs + 1.0 <add> <ide> layer = keras.layers.Lambda(add_one) <ide> <ide> ragged_input = tf.ragged.constant([[1.0], [2.0, 3.0]]) <ide> class TestStatefulLambda(keras_parameterized.TestCase): <ide> @keras_parameterized.run_with_all_model_types <ide> def test_lambda_with_variable_in_model(self): <ide> v = tf.Variable(1., trainable=True) <add> <ide> def lambda_fn(x, v): <ide> return x * v <ide> <ide> def lambda_fn(x, v): <ide> @keras_parameterized.run_all_keras_modes <ide> @keras_parameterized.run_with_all_model_types <ide> def test_creation_inside_lambda(self): <add> <ide> def lambda_fn(x): <ide> scale = tf.Variable(1., trainable=True, name='scale') <ide> shift = tf.Variable(1., trainable=True, name='shift') <ide> return x * scale + shift <ide> <del> expected_error = textwrap.dedent(r''' <add> expected_error = textwrap.dedent(r""" <ide> ( )?The following Variables were created within a Lambda layer \(shift_and_scale\) <ide> ( )?but are not tracked by said layer: <ide> ( )? <tf.Variable \'.*shift_and_scale/scale:0\'.+ <ide> ( )? <tf.Variable \'.*shift_and_scale/shift:0\'.+ <del> ( )?The layer cannot safely ensure proper Variable reuse.+''') <add> ( )?The layer cannot safely ensure proper Variable reuse.+""") <ide> <ide> with self.assertRaisesRegex(ValueError, expected_error): <ide> layer = keras.layers.Lambda(lambda_fn, name='shift_and_scale') <ide> def lambda_fn(x): <ide> @keras_parameterized.run_with_all_model_types <ide> def test_transitive_variable_creation(self): <ide> dense = keras.layers.Dense(1, use_bias=False, kernel_initializer='ones') <add> <ide> def bad_lambda_fn(x): <ide> return dense(x + 1) # Dense layer is built on first call <ide> <del> expected_error = textwrap.dedent(r''' <add> expected_error = textwrap.dedent(r""" <ide> ( )?The following Variables were created within a Lambda layer \(bias_dense\) <ide> ( )?but are not tracked by said layer: <ide> ( )? <tf.Variable \'.*bias_dense/dense/kernel:0\'.+ <del> ( )?The layer cannot safely ensure proper Variable reuse.+''') <add> ( )?The layer cannot safely ensure proper Variable reuse.+""") <ide> <ide> with self.assertRaisesRegex(ValueError, expected_error): <ide> layer = keras.layers.Lambda(bad_lambda_fn, name='bias_dense') <ide> def bad_lambda_fn(x): <ide> @keras_parameterized.run_with_all_model_types <ide> def test_warns_on_variable_capture(self): <ide> v = tf.Variable(1., trainable=True) <add> <ide> def lambda_fn(x): <ide> return x * v <ide> <del> expected_warning = textwrap.dedent(r''' <add> expected_warning = textwrap.dedent(r""" <ide> ( )?The following Variables were used a Lambda layer\'s call \(lambda\), but <ide> ( )?are not present in its tracked objects: <ide> ( )? <tf.Variable \'.*Variable:0\'.+ <del> ( )?It is possible that this is intended behavior.+''') <add> ( )?It is possible that this is intended behavior.+""") <ide> <ide> layer = keras.layers.Lambda(lambda_fn) <add> <ide> def patched_warn(msg): <ide> raise ValueError(msg) <add> <ide> layer._warn = patched_warn <ide> <ide> with self.assertRaisesRegex(ValueError, expected_warning): <ide> def test_permute_errors_on_invalid_starting_dims_index(self): <ide> with self.assertRaisesRegex(ValueError, r'Invalid permutation .*dims.*'): <ide> testing_utils.layer_test( <ide> keras.layers.Permute, <del> kwargs={'dims': (0, 1, 2)}, input_shape=(3, 2, 4)) <add> kwargs={'dims': (0, 1, 2)}, <add> input_shape=(3, 2, 4)) <ide> <ide> def test_permute_errors_on_invalid_set_of_dims_indices(self): <ide> with self.assertRaisesRegex(ValueError, r'Invalid permutation .*dims.*'): <ide> testing_utils.layer_test( <ide> keras.layers.Permute, <del> kwargs={'dims': (1, 4, 2)}, input_shape=(3, 2, 4)) <add> kwargs={'dims': (1, 4, 2)}, <add> input_shape=(3, 2, 4)) <ide> <ide> def test_flatten(self): <ide> testing_utils.layer_test( <ide> def test_flatten(self): <ide> self.assertAllClose(outputs, target_outputs) <ide> <ide> def test_flatten_scalar_channels(self): <del> testing_utils.layer_test( <del> keras.layers.Flatten, kwargs={}, input_shape=(3,)) <add> testing_utils.layer_test(keras.layers.Flatten, kwargs={}, input_shape=(3,)) <ide> <ide> # Test channels_first <ide> inputs = np.random.random((10,)).astype('float32') <ide> def test_dense_output(self): <ide> values=np.random.uniform(size=(5,)).astype('f'), <ide> dense_shape=[10, 10]) <ide> sparse_inputs = tf.sparse.reorder(sparse_inputs) <add> # Create some ragged data. <add> ragged_inputs = tf.RaggedTensor.from_row_splits( <add> np.random.uniform(size=(10, 10)).astype('f'), <add> row_splits=[0, 4, 6, 6, 9, 10]) <ide> <ide> layer = keras.layers.Dense( <ide> 5, <ide> def test_dense_output(self): <ide> dtype='float32') <ide> dense_outputs = layer(dense_inputs) <ide> sparse_outpus = layer(sparse_inputs) <add> ragged_outputs = layer(ragged_inputs) <ide> <ide> expected_dense = tf.add( <ide> tf.matmul(dense_inputs, keras.backend.get_value(layer.kernel)), <ide> def test_dense_output(self): <ide> tf.sparse.to_dense(sparse_inputs), <ide> keras.backend.get_value(layer.kernel)), <ide> keras.backend.get_value(layer.bias)) <add> expected_ragged_values = tf.add( <add> tf.matmul(ragged_inputs.flat_values, <add> keras.backend.get_value(layer.kernel)), <add> keras.backend.get_value(layer.bias)) <add> expected_ragged = tf.RaggedTensor.from_row_splits( <add> expected_ragged_values, row_splits=[0, 4, 6, 6, 9, 10]) <ide> <ide> self.assertAllClose(dense_outputs, expected_dense) <ide> self.assertAllClose(sparse_outpus, expected_sparse) <add> self.assertAllClose(ragged_outputs, expected_ragged) <ide> <ide> def test_dense_dtype(self): <del> inputs = tf.convert_to_tensor( <del> np.random.randint(low=0, high=7, size=(2, 2))) <add> inputs = tf.convert_to_tensor(np.random.randint(low=0, high=7, size=(2, 2))) <ide> layer = keras.layers.Dense(5, dtype='float32') <ide> outputs = layer(inputs) <ide> self.assertEqual(outputs.dtype, 'float32') <ide> <ide> def test_dense_with_policy(self): <del> inputs = tf.convert_to_tensor( <del> np.random.randint(low=0, high=7, size=(2, 2))) <add> inputs = tf.convert_to_tensor(np.random.randint(low=0, high=7, size=(2, 2))) <ide> layer = keras.layers.Dense(5, dtype=policy.Policy('mixed_float16')) <ide> outputs = layer(inputs) <ide> output_signature = layer.compute_output_signature( <ide> def test_numpy_inputs(self): <ide> class TFOpLambdaTest(keras_parameterized.TestCase): <ide> <ide> def test_non_tf_symbol(self): <add> <ide> def dummy_func(a, b): <ide> return a + b <ide>
2
Ruby
Ruby
add a test which ensures namespaced roots
22c0390085eed6fa2c4b78e1a9465ae3b7861568
<ide><path>actionpack/test/dispatch/routing_test.rb <ide> def self.matches?(request) <ide> match 'description', :to => "account#description", :as => "description" <ide> resource :subscription, :credit, :credit_card <ide> <add> root :to => "account#index" <add> <ide> namespace :admin do <ide> resource :subscription <ide> end <ide> def test_normalize_namespaced_matches <ide> end <ide> end <ide> <add> def test_namespaced_roots <add> with_test_routes do <add> assert_equal '/account', account_root_path <add> get '/account' <add> assert_equal 'account#index', @response.body <add> end <add> end <add> <ide> def test_optional_scoped_root <ide> with_test_routes do <ide> assert_equal '/en', root_path("en")
1
Javascript
Javascript
remove trailing space to fix lint error
60a48af9bee5289d4335475aef7c230cf3b40096
<ide><path>src/update-process-env.js <ide> const PLATFORMS_KNOWN_TO_WORK = new Set([ <ide> 'linux' <ide> ]) <ide> <del>// Shell command that returns env var=value lines separated by \0s so that <add>// Shell command that returns env var=value lines separated by \0s so that <ide> // newlines are handled properly <ide> const ENV_COMMAND = 'command awk \'BEGIN{for(v in ENVIRON) printf("%s=%s\\0",v,ENVIRON[v])}\'' <ide>
1
Java
Java
add @override to remaining source files
94685481162a93666fc2f39b66223833a6bcb418
<ide><path>spring-aop/src/main/java/org/springframework/aop/TargetSource.java <ide> public interface TargetSource extends TargetClassAware { <ide> * target class. <ide> * @return the type of targets returned by this {@link TargetSource} <ide> */ <add> @Override <ide> Class<?> getTargetClass(); <ide> <ide> /** <ide><path>spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java <ide> class TrueClassFilter implements ClassFilter, Serializable { <ide> private TrueClassFilter() { <ide> } <ide> <add> @Override <ide> public boolean matches(Class clazz) { <ide> return true; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java <ide> class TrueMethodMatcher implements MethodMatcher, Serializable { <ide> private TrueMethodMatcher() { <ide> } <ide> <add> @Override <ide> public boolean isRuntime() { <ide> return false; <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> return true; <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass, Object[] args) { <ide> // Should never be invoked as isRuntime returns false. <ide> throw new UnsupportedOperationException(); <ide><path>spring-aop/src/main/java/org/springframework/aop/TruePointcut.java <ide> class TruePointcut implements Pointcut, Serializable { <ide> private TruePointcut() { <ide> } <ide> <add> @Override <ide> public ClassFilter getClassFilter() { <ide> return ClassFilter.TRUE; <ide> } <ide> <add> @Override <ide> public MethodMatcher getMethodMatcher() { <ide> return MethodMatcher.TRUE; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java <ide> public final ClassLoader getAspectClassLoader() { <ide> return this.aspectInstanceFactory.getAspectClassLoader(); <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.aspectInstanceFactory.getOrder(); <ide> } <ide> public void setAspectName(String name) { <ide> this.aspectName = name; <ide> } <ide> <add> @Override <ide> public String getAspectName() { <ide> return this.aspectName; <ide> } <ide> public void setDeclarationOrder(int order) { <ide> this.declarationOrder = order; <ide> } <ide> <add> @Override <ide> public int getDeclarationOrder() { <ide> return this.declarationOrder; <ide> } <ide> public AdviceExcludingMethodMatcher(Method adviceMethod) { <ide> this.adviceMethod = adviceMethod; <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> return !this.adviceMethod.equals(method); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java <ide> public void setThrowingName(String throwingName) { <ide> * @param method the target {@link Method} <ide> * @return the parameter names <ide> */ <add> @Override <ide> public String[] getParameterNames(Method method) { <ide> this.argumentTypes = method.getParameterTypes(); <ide> this.numberOfRemainingUnboundArguments = this.argumentTypes.length; <ide> public String[] getParameterNames(Method method) { <ide> * @throws UnsupportedOperationException if <ide> * {@link #setRaiseExceptions(boolean) raiseExceptions} has been set to {@code true} <ide> */ <add> @Override <ide> public String[] getParameterNames(Constructor ctor) { <ide> if (this.raiseExceptions) { <ide> throw new UnsupportedOperationException("An advice method can never be a constructor"); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java <ide> public AspectJAfterAdvice( <ide> super(aspectJBeforeAdviceMethod, pointcut, aif); <ide> } <ide> <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> try { <ide> return mi.proceed(); <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> } <ide> } <ide> <add> @Override <ide> public boolean isBeforeAdvice() { <ide> return false; <ide> } <ide> <add> @Override <ide> public boolean isAfterAdvice() { <ide> return true; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterReturningAdvice.java <ide> public AspectJAfterReturningAdvice( <ide> super(aspectJBeforeAdviceMethod, pointcut, aif); <ide> } <ide> <add> @Override <ide> public boolean isBeforeAdvice() { <ide> return false; <ide> } <ide> <add> @Override <ide> public boolean isAfterAdvice() { <ide> return true; <ide> } <ide> public void setReturningName(String name) { <ide> setReturningNameNoCheck(name); <ide> } <ide> <add> @Override <ide> public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable { <ide> if (shouldInvokeOnReturnValueOf(method, returnValue)) { <ide> invokeAdviceMethod(getJoinPointMatch(), returnValue, null); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterThrowingAdvice.java <ide> public AspectJAfterThrowingAdvice( <ide> super(aspectJBeforeAdviceMethod, pointcut, aif); <ide> } <ide> <add> @Override <ide> public boolean isBeforeAdvice() { <ide> return false; <ide> } <ide> <add> @Override <ide> public boolean isAfterAdvice() { <ide> return true; <ide> } <ide> public void setThrowingName(String name) { <ide> setThrowingNameNoCheck(name); <ide> } <ide> <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> try { <ide> return mi.proceed(); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAroundAdvice.java <ide> public AspectJAroundAdvice( <ide> super(aspectJAroundAdviceMethod, pointcut, aif); <ide> } <ide> <add> @Override <ide> public boolean isBeforeAdvice() { <ide> return false; <ide> } <ide> <add> @Override <ide> public boolean isAfterAdvice() { <ide> return false; <ide> } <ide> protected boolean supportsProceedingJoinPoint() { <ide> } <ide> <ide> <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> if (!(mi instanceof ProxyMethodInvocation)) { <ide> throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java <ide> public void setParameterTypes(Class[] types) { <ide> this.pointcutParameterTypes = types; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> } <ide> <ide> <add> @Override <ide> public ClassFilter getClassFilter() { <ide> checkReadyToMatch(); <ide> return this; <ide> } <ide> <add> @Override <ide> public MethodMatcher getMethodMatcher() { <ide> checkReadyToMatch(); <ide> return this; <ide> public PointcutExpression getPointcutExpression() { <ide> return this.pointcutExpression; <ide> } <ide> <add> @Override <ide> public boolean matches(Class targetClass) { <ide> checkReadyToMatch(); <ide> try { <ide> public boolean matches(Class targetClass) { <ide> } <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass, boolean beanHasIntroductions) { <ide> checkReadyToMatch(); <ide> Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass); <ide> else if (shadowMatch.neverMatches()) { <ide> } <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> return matches(method, targetClass, false); <ide> } <ide> <add> @Override <ide> public boolean isRuntime() { <ide> checkReadyToMatch(); <ide> return this.pointcutExpression.mayNeedDynamicTest(); <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass, Object[] args) { <ide> checkReadyToMatch(); <ide> ShadowMatch shadowMatch = getShadowMatch(AopUtils.getMostSpecificMethod(method, targetClass), method); <ide> private class BeanNamePointcutDesignatorHandler implements PointcutDesignatorHan <ide> <ide> private static final String BEAN_DESIGNATOR_NAME = "bean"; <ide> <add> @Override <ide> public String getDesignatorName() { <ide> return BEAN_DESIGNATOR_NAME; <ide> } <ide> <add> @Override <ide> public ContextBasedMatcher parse(String expression) { <ide> return new BeanNameContextMatcher(expression); <ide> } <ide> public BeanNameContextMatcher(String expression) { <ide> this.expressionPattern = new NamePattern(expression); <ide> } <ide> <add> @Override <ide> public boolean couldMatchJoinPointsInType(Class someClass) { <ide> return (contextMatch(someClass) == FuzzyBoolean.YES); <ide> } <ide> <add> @Override <ide> public boolean couldMatchJoinPointsInType(Class someClass, MatchingContext context) { <ide> return (contextMatch(someClass) == FuzzyBoolean.YES); <ide> } <ide> <add> @Override <ide> public boolean matchesDynamically(MatchingContext context) { <ide> return true; <ide> } <ide> <add> @Override <ide> public FuzzyBoolean matchesStatically(MatchingContext context) { <ide> return contextMatch(null); <ide> } <ide> <add> @Override <ide> public boolean mayNeedDynamicTest() { <ide> return false; <ide> } <ide> public DefensiveShadowMatch(ShadowMatch primary, ShadowMatch other) { <ide> this.other = other; <ide> } <ide> <add> @Override <ide> public boolean alwaysMatches() { <ide> return primary.alwaysMatches(); <ide> } <ide> <add> @Override <ide> public boolean maybeMatches() { <ide> return primary.maybeMatches(); <ide> } <ide> <add> @Override <ide> public boolean neverMatches() { <ide> return primary.neverMatches(); <ide> } <ide> <add> @Override <ide> public JoinPointMatch matchesJoinPoint(Object thisObject, <ide> Object targetObject, Object[] args) { <ide> try { <ide> public JoinPointMatch matchesJoinPoint(Object thisObject, <ide> } <ide> } <ide> <add> @Override <ide> public void setMatchingContext(MatchingContext aMatchContext) { <ide> primary.setMatchingContext(aMatchContext); <ide> other.setMatchingContext(aMatchContext); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java <ide> public class AspectJExpressionPointcutAdvisor extends AbstractGenericPointcutAdv <ide> private final AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut(); <ide> <ide> <add> @Override <ide> public Pointcut getPointcut() { <ide> return this.pointcut; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJMethodBeforeAdvice.java <ide> public AspectJMethodBeforeAdvice( <ide> super(aspectJBeforeAdviceMethod, pointcut, aif); <ide> } <ide> <add> @Override <ide> public void before(Method method, Object[] args, Object target) throws Throwable { <ide> invokeAdviceMethod(getJoinPointMatch(), null, null); <ide> } <ide> <add> @Override <ide> public boolean isBeforeAdvice() { <ide> return true; <ide> } <ide> <add> @Override <ide> public boolean isAfterAdvice() { <ide> return false; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJPointcutAdvisor.java <ide> public void setOrder(int order) { <ide> } <ide> <ide> <add> @Override <ide> public boolean isPerInstance() { <ide> return true; <ide> } <ide> <add> @Override <ide> public Advice getAdvice() { <ide> return this.advice; <ide> } <ide> <add> @Override <ide> public Pointcut getPointcut() { <ide> return this.pointcut; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> if (this.order != null) { <ide> return this.order; <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java <ide> public class AspectJWeaverMessageHandler implements IMessageHandler { <ide> private static final Log LOGGER = LogFactory.getLog("AspectJ Weaver"); <ide> <ide> <add> @Override <ide> public boolean handleMessage(IMessage message) throws AbortException { <ide> Kind messageKind = message.getKind(); <ide> <ide> private String makeMessageFor(IMessage aMessage) { <ide> return AJ_ID + aMessage.getMessage(); <ide> } <ide> <add> @Override <ide> public boolean isIgnoring(Kind messageKind) { <ide> // We want to see everything, and allow configuration of log levels dynamically. <ide> return false; <ide> } <ide> <add> @Override <ide> public void dontIgnore(Kind messageKind) { <ide> // We weren't ignoring anything anyway... <ide> } <ide> <add> @Override <ide> public void ignore(Kind kind) { <ide> // We weren't ignoring anything anyway... <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java <ide> private DeclareParentsAdvisor(Class interfaceType, String typePattern, Class imp <ide> <ide> // Excludes methods implemented. <ide> ClassFilter exclusion = new ClassFilter() { <add> @Override <ide> public boolean matches(Class clazz) { <ide> return !(introducedInterface.isAssignableFrom(clazz)); <ide> } <ide> public boolean matches(Class clazz) { <ide> } <ide> <ide> <add> @Override <ide> public ClassFilter getClassFilter() { <ide> return this.typePatternClassFilter; <ide> } <ide> <add> @Override <ide> public void validateInterfaces() throws IllegalArgumentException { <ide> // Do nothing <ide> } <ide> <add> @Override <ide> public boolean isPerInstance() { <ide> return true; <ide> } <ide> <add> @Override <ide> public Advice getAdvice() { <ide> return this.advice; <ide> } <ide> <add> @Override <ide> public Class[] getInterfaces() { <ide> return new Class[] {this.introducedInterface}; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java <ide> public MethodInvocationProceedingJoinPoint(ProxyMethodInvocation methodInvocatio <ide> this.methodInvocation = methodInvocation; <ide> } <ide> <add> @Override <ide> public void set$AroundClosure(AroundClosure aroundClosure) { <ide> throw new UnsupportedOperationException(); <ide> } <ide> <add> @Override <ide> public Object proceed() throws Throwable { <ide> return this.methodInvocation.invocableClone().proceed(); <ide> } <ide> <add> @Override <ide> public Object proceed(Object[] arguments) throws Throwable { <ide> Assert.notNull(arguments, "Argument array passed to proceed cannot be null"); <ide> if (arguments.length != this.methodInvocation.getArguments().length) { <ide> public Object proceed(Object[] arguments) throws Throwable { <ide> /** <ide> * Returns the Spring AOP proxy. Cannot be {@code null}. <ide> */ <add> @Override <ide> public Object getThis() { <ide> return this.methodInvocation.getProxy(); <ide> } <ide> <ide> /** <ide> * Returns the Spring AOP target. May be {@code null} if there is no target. <ide> */ <add> @Override <ide> public Object getTarget() { <ide> return this.methodInvocation.getThis(); <ide> } <ide> <add> @Override <ide> public Object[] getArgs() { <ide> if (this.defensiveCopyOfArgs == null) { <ide> Object[] argsSource = this.methodInvocation.getArguments(); <ide> public Object[] getArgs() { <ide> return this.defensiveCopyOfArgs; <ide> } <ide> <add> @Override <ide> public Signature getSignature() { <ide> if (this.signature == null) { <ide> this.signature = new MethodSignatureImpl(); <ide> } <ide> return signature; <ide> } <ide> <add> @Override <ide> public SourceLocation getSourceLocation() { <ide> if (this.sourceLocation == null) { <ide> this.sourceLocation = new SourceLocationImpl(); <ide> } <ide> return this.sourceLocation; <ide> } <ide> <add> @Override <ide> public String getKind() { <ide> return ProceedingJoinPoint.METHOD_EXECUTION; <ide> } <ide> <add> @Override <ide> public int getId() { <ide> // TODO: It's just an adapter but returning 0 might still have side effects... <ide> return 0; <ide> } <ide> <add> @Override <ide> public JoinPoint.StaticPart getStaticPart() { <ide> return this; <ide> } <ide> <add> @Override <ide> public String toShortString() { <ide> return "execution(" + getSignature().toShortString() + ")"; <ide> } <ide> <add> @Override <ide> public String toLongString() { <ide> return "execution(" + getSignature().toLongString() + ")"; <ide> } <ide> <add> @Override <ide> public String toString() { <ide> return "execution(" + getSignature().toString() + ")"; <ide> } <ide> private class MethodSignatureImpl implements MethodSignature { <ide> <ide> private volatile String[] parameterNames; <ide> <add> @Override <ide> public String getName() { <ide> return methodInvocation.getMethod().getName(); <ide> } <ide> <add> @Override <ide> public int getModifiers() { <ide> return methodInvocation.getMethod().getModifiers(); <ide> } <ide> <add> @Override <ide> public Class getDeclaringType() { <ide> return methodInvocation.getMethod().getDeclaringClass(); <ide> } <ide> <add> @Override <ide> public String getDeclaringTypeName() { <ide> return methodInvocation.getMethod().getDeclaringClass().getName(); <ide> } <ide> <add> @Override <ide> public Class getReturnType() { <ide> return methodInvocation.getMethod().getReturnType(); <ide> } <ide> <add> @Override <ide> public Method getMethod() { <ide> return methodInvocation.getMethod(); <ide> } <ide> <add> @Override <ide> public Class[] getParameterTypes() { <ide> return methodInvocation.getMethod().getParameterTypes(); <ide> } <ide> <add> @Override <ide> public String[] getParameterNames() { <ide> if (this.parameterNames == null) { <ide> this.parameterNames = (new LocalVariableTableParameterNameDiscoverer()).getParameterNames(getMethod()); <ide> } <ide> return this.parameterNames; <ide> } <ide> <add> @Override <ide> public Class[] getExceptionTypes() { <ide> return methodInvocation.getMethod().getExceptionTypes(); <ide> } <ide> <add> @Override <ide> public String toShortString() { <ide> return toString(false, false, false, false); <ide> } <ide> <add> @Override <ide> public String toLongString() { <ide> return toString(true, true, true, true); <ide> } <ide> <add> @Override <ide> public String toString() { <ide> return toString(false, true, false, true); <ide> } <ide> private void appendType(StringBuilder sb, Class<?> type, boolean useLongTypeName <ide> */ <ide> private class SourceLocationImpl implements SourceLocation { <ide> <add> @Override <ide> public Class getWithinType() { <ide> if (methodInvocation.getThis() == null) { <ide> throw new UnsupportedOperationException("No source location joinpoint available: target is null"); <ide> } <ide> return methodInvocation.getThis().getClass(); <ide> } <ide> <add> @Override <ide> public String getFileName() { <ide> throw new UnsupportedOperationException(); <ide> } <ide> <add> @Override <ide> public int getLine() { <ide> throw new UnsupportedOperationException(); <ide> } <ide> <add> @Override <ide> public int getColumn() { <ide> throw new UnsupportedOperationException(); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java <ide> private static class TestVisitorAdapter implements ITestVisitor { <ide> protected static final int AT_TARGET_VAR = 4; <ide> protected static final int AT_ANNOTATION_VAR = 8; <ide> <add> @Override <ide> public void visit(And e) { <ide> e.getLeft().accept(this); <ide> e.getRight().accept(this); <ide> } <ide> <add> @Override <ide> public void visit(Or e) { <ide> e.getLeft().accept(this); <ide> e.getRight().accept(this); <ide> } <ide> <add> @Override <ide> public void visit(Not e) { <ide> e.getBody().accept(this); <ide> } <ide> <add> @Override <ide> public void visit(Instanceof i) { <ide> } <ide> <add> @Override <ide> public void visit(Literal literal) { <ide> } <ide> <add> @Override <ide> public void visit(Call call) { <ide> } <ide> <add> @Override <ide> public void visit(FieldGetCall fieldGetCall) { <ide> } <ide> <add> @Override <ide> public void visit(HasAnnotation hasAnnotation) { <ide> } <ide> <add> @Override <ide> public void visit(MatchingContextBasedTest matchingContextTest) { <ide> } <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java <ide> public final Class getAspectClass() { <ide> } <ide> <ide> <add> @Override <ide> public final Object getAspectInstance() { <ide> try { <ide> return this.aspectClass.newInstance(); <ide> public final Object getAspectInstance() { <ide> } <ide> } <ide> <add> @Override <ide> public ClassLoader getAspectClassLoader() { <ide> return this.aspectClass.getClassLoader(); <ide> } <ide> public ClassLoader getAspectClassLoader() { <ide> * @see org.springframework.core.Ordered <ide> * @see #getOrderForAspectClass <ide> */ <add> @Override <ide> public int getOrder() { <ide> return getOrderForAspectClass(this.aspectClass); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java <ide> public SingletonAspectInstanceFactory(Object aspectInstance) { <ide> } <ide> <ide> <add> @Override <ide> public final Object getAspectInstance() { <ide> return this.aspectInstance; <ide> } <ide> <add> @Override <ide> public ClassLoader getAspectClassLoader() { <ide> return this.aspectInstance.getClass().getClassLoader(); <ide> } <ide> public ClassLoader getAspectClassLoader() { <ide> * @see org.springframework.core.Ordered <ide> * @see #getOrderForAspectClass <ide> */ <add> @Override <ide> public int getOrder() { <ide> if (this.aspectInstance instanceof Ordered) { <ide> return ((Ordered) this.aspectInstance).getOrder(); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java <ide> public String getTypePattern() { <ide> * @return whether the advice should apply to this candidate target class <ide> * @throws IllegalStateException if no {@link #setTypePattern(String)} has been set <ide> */ <add> @Override <ide> public boolean matches(Class clazz) { <ide> if (this.aspectJTypePatternMatcher == null) { <ide> throw new IllegalStateException("No 'typePattern' has been set via ctor/setter."); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java <ide> protected AbstractAspectJAdvisorFactory() { <ide> * is that aspects written in the code-style (AspectJ language) also have the annotation present <ide> * when compiled by ajc with the -1.5 flag, yet they cannot be consumed by Spring AOP. <ide> */ <add> @Override <ide> public boolean isAspect(Class<?> clazz) { <ide> return (hasAspectAnnotation(clazz) && !compiledByAjc(clazz)); <ide> } <ide> private boolean compiledByAjc(Class<?> clazz) { <ide> return false; <ide> } <ide> <add> @Override <ide> public void validate(Class<?> aspectClass) throws AopConfigException { <ide> // If the parent has the annotation and isn't abstract it's an error <ide> if (aspectClass.getSuperclass().getAnnotation(Aspect.class) != null && <ide> public String toString() { <ide> */ <ide> private static class AspectJAnnotationParameterNameDiscoverer implements ParameterNameDiscoverer { <ide> <add> @Override <ide> public String[] getParameterNames(Method method) { <ide> if (method.getParameterTypes().length == 0) { <ide> return new String[0]; <ide> public String[] getParameterNames(Method method) { <ide> } <ide> } <ide> <add> @Override <ide> public String[] getParameterNames(Constructor ctor) { <ide> throw new UnsupportedOperationException("Spring AOP cannot handle constructor advice"); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java <ide> public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name, Cl <ide> } <ide> <ide> <add> @Override <ide> public Object getAspectInstance() { <ide> return this.beanFactory.getBean(this.name); <ide> } <ide> <add> @Override <ide> public ClassLoader getAspectClassLoader() { <ide> if (this.beanFactory instanceof ConfigurableBeanFactory) { <ide> return ((ConfigurableBeanFactory) this.beanFactory).getBeanClassLoader(); <ide> public ClassLoader getAspectClassLoader() { <ide> } <ide> } <ide> <add> @Override <ide> public AspectMetadata getAspectMetadata() { <ide> return this.aspectMetadata; <ide> } <ide> public AspectMetadata getAspectMetadata() { <ide> * @see org.springframework.core.Ordered <ide> * @see org.springframework.core.annotation.Order <ide> */ <add> @Override <ide> public int getOrder() { <ide> Class<?> type = this.beanFactory.getType(this.name); <ide> if (type != null) { <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java <ide> public InstantiationModelAwarePointcutAdvisorImpl(AspectJAdvisorFactory af, Aspe <ide> * The pointcut for Spring AOP to use. Actual behaviour of the pointcut will change <ide> * depending on the state of the advice. <ide> */ <add> @Override <ide> public Pointcut getPointcut() { <ide> return this.pointcut; <ide> } <ide> public Pointcut getPointcut() { <ide> * are much richer. In AspectJ terminology, all a return of {@code true} <ide> * means here is that the aspect is not a SINGLETON. <ide> */ <add> @Override <ide> public boolean isPerInstance() { <ide> return (getAspectMetadata().getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON); <ide> } <ide> public AspectMetadata getAspectMetadata() { <ide> /** <ide> * Lazily instantiate advice if necessary. <ide> */ <add> @Override <ide> public synchronized Advice getAdvice() { <ide> if (this.instantiatedAdvice == null) { <ide> this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut); <ide> } <ide> return this.instantiatedAdvice; <ide> } <ide> <add> @Override <ide> public boolean isLazy() { <ide> return this.lazy; <ide> } <ide> <add> @Override <ide> public synchronized boolean isAdviceInstantiated() { <ide> return (this.instantiatedAdvice != null); <ide> } <ide> public AspectJExpressionPointcut getDeclaredPointcut() { <ide> return this.declaredPointcut; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.aspectInstanceFactory.getOrder(); <ide> } <ide> <add> @Override <ide> public String getAspectName() { <ide> return this.aspectName; <ide> } <ide> <add> @Override <ide> public int getDeclarationOrder() { <ide> return this.declarationOrder; <ide> } <ide> <add> @Override <ide> public boolean isBeforeAdvice() { <ide> if (this.isBeforeAdvice == null) { <ide> determineAdviceType(); <ide> } <ide> return this.isBeforeAdvice; <ide> } <ide> <add> @Override <ide> public boolean isAfterAdvice() { <ide> if (this.isAfterAdvice == null) { <ide> determineAdviceType(); <ide> public boolean matches(Method method, Class targetClass) { <ide> this.preInstantiationPointcut.getMethodMatcher().matches(method, targetClass); <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass, Object[] args) { <ide> // This can match only on declared pointcut. <ide> return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/LazySingletonAspectInstanceFactoryDecorator.java <ide> public LazySingletonAspectInstanceFactoryDecorator(MetadataAwareAspectInstanceFa <ide> } <ide> <ide> <add> @Override <ide> public synchronized Object getAspectInstance() { <ide> if (this.materialized == null) { <ide> synchronized (this) { <ide> public boolean isMaterialized() { <ide> return (this.materialized != null); <ide> } <ide> <add> @Override <ide> public ClassLoader getAspectClassLoader() { <ide> return this.maaif.getAspectClassLoader(); <ide> } <ide> <add> @Override <ide> public AspectMetadata getAspectMetadata() { <ide> return this.maaif.getAspectMetadata(); <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.maaif.getOrder(); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java <ide> public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto <ide> new InstanceComparator<Annotation>( <ide> Around.class, Before.class, After.class, AfterReturning.class, AfterThrowing.class), <ide> new Converter<Method, Annotation>() { <add> @Override <ide> public Annotation convert(Method method) { <ide> AspectJAnnotation<?> annotation = AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method); <ide> return annotation == null ? null : annotation.getAnnotation(); <ide> } <ide> })); <ide> comparator.addComparator(new ConvertingComparator<Method, String>( <ide> new Converter<Method, String>() { <add> @Override <ide> public String convert(Method method) { <ide> return method.getName(); <ide> } <ide> public String convert(Method method) { <ide> } <ide> <ide> <add> @Override <ide> public List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory maaif) { <ide> final Class<?> aspectClass = maaif.getAspectMetadata().getAspectClass(); <ide> final String aspectName = maaif.getAspectMetadata().getAspectName(); <ide> public List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory maaif) { <ide> private List<Method> getAdvisorMethods(Class<?> aspectClass) { <ide> final List<Method> methods = new LinkedList<Method>(); <ide> ReflectionUtils.doWithMethods(aspectClass, new ReflectionUtils.MethodCallback() { <add> @Override <ide> public void doWith(Method method) throws IllegalArgumentException { <ide> // Exclude pointcuts <ide> if (AnnotationUtils.getAnnotation(method, Pointcut.class) == null) { <ide> private Advisor getDeclareParentsAdvisor(Field introductionField) { <ide> } <ide> <ide> <add> @Override <ide> public Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aif, <ide> int declarationOrderInAspect, String aspectName) { <ide> <ide> private AspectJExpressionPointcut getPointcut(Method candidateAdviceMethod, Clas <ide> } <ide> <ide> <add> @Override <ide> public Advice getAdvice(Method candidateAdviceMethod, AspectJExpressionPointcut ajexp, <ide> MetadataAwareAspectInstanceFactory aif, int declarationOrderInAspect, String aspectName) { <ide> <ide> protected static class SyntheticInstantiationAdvisor extends DefaultPointcutAdvi <ide> <ide> public SyntheticInstantiationAdvisor(final MetadataAwareAspectInstanceFactory aif) { <ide> super(aif.getAspectMetadata().getPerClausePointcut(), new MethodBeforeAdvice() { <add> @Override <ide> public void before(Method method, Object[] args, Object target) { <ide> // Simply instantiate the aspect <ide> aif.getAspectInstance(); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java <ide> public SimpleMetadataAwareAspectInstanceFactory(Class aspectClass, String aspect <ide> } <ide> <ide> <add> @Override <ide> public final AspectMetadata getAspectMetadata() { <ide> return this.metadata; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java <ide> public SingletonMetadataAwareAspectInstanceFactory(Object aspectInstance, String <ide> } <ide> <ide> <add> @Override <ide> public final AspectMetadata getAspectMetadata() { <ide> return this.metadata; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java <ide> public PartiallyComparableAdvisorHolder(Advisor advisor, Comparator<Advisor> com <ide> this.comparator = comparator; <ide> } <ide> <add> @Override <ide> public int compareTo(Object obj) { <ide> Advisor otherAdvisor = ((PartiallyComparableAdvisorHolder) obj).advisor; <ide> return this.comparator.compare(this.advisor, otherAdvisor); <ide> } <ide> <add> @Override <ide> public int fallbackCompareTo(Object obj) { <ide> return 0; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java <ide> public AspectJPrecedenceComparator(Comparator<? super Advisor> advisorComparator <ide> } <ide> <ide> <add> @Override <ide> public int compare(Object o1, Object o2) { <ide> if (!(o1 instanceof Advisor && o2 instanceof Advisor)) { <ide> throw new IllegalArgumentException( <ide><path>spring-aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java <ide> */ <ide> public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator implements BeanDefinitionDecorator { <ide> <add> @Override <ide> public final BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext) { <ide> BeanDefinitionRegistry registry = parserContext.getRegistry(); <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/config/AdvisorComponentDefinition.java <ide> private String buildDescription(BeanReference adviceReference, BeanReference poi <ide> } <ide> <ide> <add> @Override <ide> public String getName() { <ide> return this.advisorBeanName; <ide> } <ide> public BeanReference[] getBeanReferences() { <ide> return this.beanReferences; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.advisorDefinition.getSource(); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java <ide> public class AopNamespaceHandler extends NamespaceHandlerSupport { <ide> * '{@code config}', '{@code spring-configured}', '{@code aspectj-autoproxy}' <ide> * and '{@code scoped-proxy}' tags. <ide> */ <add> @Override <ide> public void init() { <ide> // In 2.0 XSD as well as in 2.1 XSD. <ide> registerBeanDefinitionParser("config", new ConfigBeanDefinitionParser()); <ide><path>spring-aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java <ide> */ <ide> class AspectJAutoProxyBeanDefinitionParser implements BeanDefinitionParser { <ide> <add> @Override <ide> public BeanDefinition parse(Element element, ParserContext parserContext) { <ide> AopNamespaceUtils.registerAspectJAnnotationAutoProxyCreatorIfNecessary(parserContext, element); <ide> extendBeanDefinition(element, parserContext); <ide><path>spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java <ide> class ConfigBeanDefinitionParser implements BeanDefinitionParser { <ide> private ParseState parseState = new ParseState(); <ide> <ide> <add> @Override <ide> public BeanDefinition parse(Element element, ParserContext parserContext) { <ide> CompositeComponentDefinition compositeDef = <ide> new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element)); <ide><path>spring-aop/src/main/java/org/springframework/aop/config/MethodLocatingFactoryBean.java <ide> public void setMethodName(String methodName) { <ide> this.methodName = methodName; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> if (!StringUtils.hasText(this.targetBeanName)) { <ide> throw new IllegalArgumentException("Property 'targetBeanName' is required"); <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> } <ide> <ide> <add> @Override <ide> public Method getObject() throws Exception { <ide> return this.method; <ide> } <ide> <add> @Override <ide> public Class<Method> getObjectType() { <ide> return Method.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/config/PointcutComponentDefinition.java <ide> public PointcutComponentDefinition(String pointcutBeanName, BeanDefinition point <ide> } <ide> <ide> <add> @Override <ide> public String getName() { <ide> return this.pointcutBeanName; <ide> } <ide> public BeanDefinition[] getBeanDefinitions() { <ide> return new BeanDefinition[] {this.pointcutDefinition}; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.pointcutDefinition.getSource(); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java <ide> class ScopedProxyBeanDefinitionDecorator implements BeanDefinitionDecorator { <ide> private static final String PROXY_TARGET_CLASS = "proxy-target-class"; <ide> <ide> <add> @Override <ide> public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) { <ide> boolean proxyTargetClass = true; <ide> if (node instanceof Element) { <ide><path>spring-aop/src/main/java/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.java <ide> public void setAspectBeanName(String aspectBeanName) { <ide> this.aspectBeanName = aspectBeanName; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> if (!StringUtils.hasText(this.aspectBeanName)) { <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> * Look up the aspect bean from the {@link BeanFactory} and returns it. <ide> * @see #setAspectBeanName <ide> */ <add> @Override <ide> public Object getAspectInstance() { <ide> return this.beanFactory.getBean(this.aspectBeanName); <ide> } <ide> <add> @Override <ide> public ClassLoader getAspectClassLoader() { <ide> if (this.beanFactory instanceof ConfigurableBeanFactory) { <ide> return ((ConfigurableBeanFactory) this.beanFactory).getBeanClassLoader(); <ide> public ClassLoader getAspectClassLoader() { <ide> } <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> if (this.beanFactory.isSingleton(this.aspectBeanName) && <ide> this.beanFactory.isTypeMatch(this.aspectBeanName, Ordered.class)) { <ide><path>spring-aop/src/main/java/org/springframework/aop/config/SpringConfiguredBeanDefinitionParser.java <ide> class SpringConfiguredBeanDefinitionParser implements BeanDefinitionParser { <ide> "org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect"; <ide> <ide> <add> @Override <ide> public BeanDefinition parse(Element element, ParserContext parserContext) { <ide> if (!parserContext.getRegistry().containsBeanDefinition(BEAN_CONFIGURER_ASPECT_BEAN_NAME)) { <ide> RootBeanDefinition def = new RootBeanDefinition(); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java <ide> public void setBeforeExistingAdvisors(boolean beforeExistingAdvisors) { <ide> this.beforeExistingAdvisors = beforeExistingAdvisors; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader beanClassLoader) { <ide> this.beanClassLoader = beanClassLoader; <ide> } <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> <ide> <add> @Override <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) { <ide> return bean; <ide> } <ide> <add> @Override <ide> public Object postProcessAfterInitialization(Object bean, String beanName) { <ide> if (bean instanceof AopInfrastructureBean) { <ide> // Ignore AOP infrastructure such as scoped proxies. <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.java <ide> public void setProxyClassLoader(ClassLoader classLoader) { <ide> this.proxyClassLoader = classLoader; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader classLoader) { <ide> if (this.proxyClassLoader == null) { <ide> this.proxyClassLoader = classLoader; <ide> } <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> if (this.target == null) { <ide> throw new IllegalArgumentException("Property 'target' is required"); <ide> protected TargetSource createTargetSource(Object target) { <ide> } <ide> <ide> <add> @Override <ide> public Object getObject() { <ide> if (this.proxy == null) { <ide> throw new FactoryBeanNotInitializedException(); <ide> } <ide> return this.proxy; <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> if (this.proxy != null) { <ide> return this.proxy.getClass(); <ide> public Class<?> getObjectType() { <ide> return null; <ide> } <ide> <add> @Override <ide> public final boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java <ide> public void setTarget(Object target) { <ide> setTargetSource(new SingletonTargetSource(target)); <ide> } <ide> <add> @Override <ide> public void setTargetSource(TargetSource targetSource) { <ide> this.targetSource = (targetSource != null ? targetSource : EMPTY_TARGET_SOURCE); <ide> } <ide> <add> @Override <ide> public TargetSource getTargetSource() { <ide> return this.targetSource; <ide> } <ide> public void setTargetClass(Class targetClass) { <ide> this.targetSource = EmptyTargetSource.forClass(targetClass); <ide> } <ide> <add> @Override <ide> public Class<?> getTargetClass() { <ide> return this.targetSource.getTargetClass(); <ide> } <ide> <add> @Override <ide> public void setPreFiltered(boolean preFiltered) { <ide> this.preFiltered = preFiltered; <ide> } <ide> <add> @Override <ide> public boolean isPreFiltered() { <ide> return this.preFiltered; <ide> } <ide> public boolean removeInterface(Class intf) { <ide> return this.interfaces.remove(intf); <ide> } <ide> <add> @Override <ide> public Class[] getProxiedInterfaces() { <ide> return this.interfaces.toArray(new Class[this.interfaces.size()]); <ide> } <ide> <add> @Override <ide> public boolean isInterfaceProxied(Class intf) { <ide> for (Class proxyIntf : this.interfaces) { <ide> if (intf.isAssignableFrom(proxyIntf)) { <ide> public boolean isInterfaceProxied(Class intf) { <ide> } <ide> <ide> <add> @Override <ide> public final Advisor[] getAdvisors() { <ide> return this.advisorArray; <ide> } <ide> <add> @Override <ide> public void addAdvisor(Advisor advisor) { <ide> int pos = this.advisors.size(); <ide> addAdvisor(pos, advisor); <ide> } <ide> <add> @Override <ide> public void addAdvisor(int pos, Advisor advisor) throws AopConfigException { <ide> if (advisor instanceof IntroductionAdvisor) { <ide> validateIntroductionAdvisor((IntroductionAdvisor) advisor); <ide> } <ide> addAdvisorInternal(pos, advisor); <ide> } <ide> <add> @Override <ide> public boolean removeAdvisor(Advisor advisor) { <ide> int index = indexOf(advisor); <ide> if (index == -1) { <ide> public boolean removeAdvisor(Advisor advisor) { <ide> } <ide> } <ide> <add> @Override <ide> public void removeAdvisor(int index) throws AopConfigException { <ide> if (isFrozen()) { <ide> throw new AopConfigException("Cannot remove Advisor: Configuration is frozen."); <ide> public void removeAdvisor(int index) throws AopConfigException { <ide> adviceChanged(); <ide> } <ide> <add> @Override <ide> public int indexOf(Advisor advisor) { <ide> Assert.notNull(advisor, "Advisor must not be null"); <ide> return this.advisors.indexOf(advisor); <ide> } <ide> <add> @Override <ide> public boolean replaceAdvisor(Advisor a, Advisor b) throws AopConfigException { <ide> Assert.notNull(a, "Advisor a must not be null"); <ide> Assert.notNull(b, "Advisor b must not be null"); <ide> protected final List<Advisor> getAdvisorsInternal() { <ide> } <ide> <ide> <add> @Override <ide> public void addAdvice(Advice advice) throws AopConfigException { <ide> int pos = this.advisors.size(); <ide> addAdvice(pos, advice); <ide> public void addAdvice(Advice advice) throws AopConfigException { <ide> /** <ide> * Cannot add introductions this way unless the advice implements IntroductionInfo. <ide> */ <add> @Override <ide> public void addAdvice(int pos, Advice advice) throws AopConfigException { <ide> Assert.notNull(advice, "Advice must not be null"); <ide> if (advice instanceof IntroductionInfo) { <ide> else if (advice instanceof DynamicIntroductionAdvice) { <ide> } <ide> } <ide> <add> @Override <ide> public boolean removeAdvice(Advice advice) throws AopConfigException { <ide> int index = indexOf(advice); <ide> if (index == -1) { <ide> public boolean removeAdvice(Advice advice) throws AopConfigException { <ide> } <ide> } <ide> <add> @Override <ide> public int indexOf(Advice advice) { <ide> Assert.notNull(advice, "Advice must not be null"); <ide> for (int i = 0; i < this.advisors.size(); i++) { <ide> private void readObject(ObjectInputStream ois) throws IOException, ClassNotFound <ide> } <ide> <ide> <add> @Override <ide> public String toProxyConfigString() { <ide> return toString(); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java <ide> public void setConstructorArguments(Object[] constructorArgs, Class<?>[] constru <ide> } <ide> <ide> <add> @Override <ide> public Object getProxy() { <ide> return getProxy(null); <ide> } <ide> <add> @Override <ide> public Object getProxy(ClassLoader classLoader) { <ide> if (logger.isDebugEnabled()) { <ide> logger.debug("Creating CGLIB proxy: target source is " + this.advised.getTargetSource()); <ide> public StaticUnadvisedInterceptor(Object target) { <ide> this.target = target; <ide> } <ide> <add> @Override <ide> public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { <ide> Object retVal = methodProxy.invoke(this.target, args); <ide> return processReturnType(proxy, this.target, method, retVal); <ide> public StaticUnadvisedExposedInterceptor(Object target) { <ide> this.target = target; <ide> } <ide> <add> @Override <ide> public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { <ide> Object oldProxy = null; <ide> try { <ide> public DynamicUnadvisedInterceptor(TargetSource targetSource) { <ide> this.targetSource = targetSource; <ide> } <ide> <add> @Override <ide> public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { <ide> Object target = this.targetSource.getTarget(); <ide> try { <ide> public DynamicUnadvisedExposedInterceptor(TargetSource targetSource) { <ide> this.targetSource = targetSource; <ide> } <ide> <add> @Override <ide> public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { <ide> Object oldProxy = null; <ide> Object target = this.targetSource.getTarget(); <ide> public StaticDispatcher(Object target) { <ide> this.target = target; <ide> } <ide> <add> @Override <ide> public Object loadObject() { <ide> return this.target; <ide> } <ide> public AdvisedDispatcher(AdvisedSupport advised) { <ide> this.advised = advised; <ide> } <ide> <add> @Override <ide> public Object loadObject() throws Exception { <ide> return this.advised; <ide> } <ide> public EqualsInterceptor(AdvisedSupport advised) { <ide> this.advised = advised; <ide> } <ide> <add> @Override <ide> public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) { <ide> Object other = args[0]; <ide> if (proxy == other) { <ide> public HashCodeInterceptor(AdvisedSupport advised) { <ide> this.advised = advised; <ide> } <ide> <add> @Override <ide> public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) { <ide> return CglibAopProxy.class.hashCode() * 13 + this.advised.getTargetSource().hashCode(); <ide> } <ide> public FixedChainStaticTargetInterceptor(List<Object> adviceChain, Object target <ide> this.targetClass = targetClass; <ide> } <ide> <add> @Override <ide> public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { <ide> MethodInvocation invocation = new CglibMethodInvocation(proxy, this.target, method, args, <ide> this.targetClass, this.adviceChain, methodProxy); <ide> public DynamicAdvisedInterceptor(AdvisedSupport advised) { <ide> this.advised = advised; <ide> } <ide> <add> @Override <ide> public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { <ide> Object oldProxy = null; <ide> boolean setProxyContext = false; <ide> public ProxyCallbackFilter(AdvisedSupport advised, Map<String, Integer> fixedInt <ide> * DynamicUnadvisedInterceptor already considers this.</dd> <ide> * </dl> <ide> */ <add> @Override <ide> public int accept(Method method) { <ide> if (AopUtils.isFinalizeMethod(method)) { <ide> logger.debug("Found finalize() method - using NO_OVERRIDE"); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java <ide> @SuppressWarnings("serial") <ide> public class DefaultAdvisorChainFactory implements AdvisorChainFactory, Serializable { <ide> <add> @Override <ide> public List<Object> getInterceptorsAndDynamicInterceptionAdvice( <ide> Advised config, Method method, Class targetClass) { <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/DefaultAopProxyFactory.java <ide> public class DefaultAopProxyFactory implements AopProxyFactory, Serializable { <ide> <ide> <add> @Override <ide> public AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException { <ide> if (config.isOptimize() || config.isProxyTargetClass() || hasNoUserSuppliedProxyInterfaces(config)) { <ide> Class targetClass = config.getTargetClass(); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java <ide> public JdkDynamicAopProxy(AdvisedSupport config) throws AopConfigException { <ide> } <ide> <ide> <add> @Override <ide> public Object getProxy() { <ide> return getProxy(ClassUtils.getDefaultClassLoader()); <ide> } <ide> <add> @Override <ide> public Object getProxy(ClassLoader classLoader) { <ide> if (logger.isDebugEnabled()) { <ide> logger.debug("Creating JDK dynamic proxy: target source is " + this.advised.getTargetSource()); <ide> private void findDefinedEqualsAndHashCodeMethods(Class[] proxiedInterfaces) { <ide> * <p>Callers will see exactly the exception thrown by the target, <ide> * unless a hook method throws an exception. <ide> */ <add> @Override <ide> public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { <ide> MethodInvocation invocation; <ide> Object oldProxy = null; <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java <ide> public void setProxyClassLoader(ClassLoader classLoader) { <ide> this.classLoaderConfigured = (classLoader != null); <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader classLoader) { <ide> if (!this.classLoaderConfigured) { <ide> this.proxyClassLoader = classLoader; <ide> } <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> checkInterceptorNames(); <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> * {@code getObject()} for a proxy. <ide> * @return a fresh AOP proxy reflecting the current state of this factory <ide> */ <add> @Override <ide> public Object getObject() throws BeansException { <ide> initializeAdvisorChain(); <ide> if (isSingleton()) { <ide> public Object getObject() throws BeansException { <ide> * a single one), the target bean type, or the TargetSource's target class. <ide> * @see org.springframework.aop.TargetSource#getTargetClass <ide> */ <add> @Override <ide> public Class<?> getObjectType() { <ide> synchronized (this) { <ide> if (this.singletonInstance != null) { <ide> else if (this.targetName != null && this.beanFactory != null) { <ide> } <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return this.singleton; <ide> } <ide> public String getBeanName() { <ide> return beanName; <ide> } <ide> <add> @Override <ide> public Advice getAdvice() { <ide> throw new UnsupportedOperationException("Cannot invoke methods: " + this.message); <ide> } <ide> <add> @Override <ide> public boolean isPerInstance() { <ide> throw new UnsupportedOperationException("Cannot invoke methods: " + this.message); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java <ide> protected ReflectiveMethodInvocation( <ide> } <ide> <ide> <add> @Override <ide> public final Object getProxy() { <ide> return this.proxy; <ide> } <ide> <add> @Override <ide> public final Object getThis() { <ide> return this.target; <ide> } <ide> <add> @Override <ide> public final AccessibleObject getStaticPart() { <ide> return this.method; <ide> } <ide> public final AccessibleObject getStaticPart() { <ide> * May or may not correspond with a method invoked on an underlying <ide> * implementation of that interface. <ide> */ <add> @Override <ide> public final Method getMethod() { <ide> return this.method; <ide> } <ide> <add> @Override <ide> public final Object[] getArguments() { <ide> return (this.arguments != null ? this.arguments : new Object[0]); <ide> } <ide> <add> @Override <ide> public void setArguments(Object[] arguments) { <ide> this.arguments = arguments; <ide> } <ide> <ide> <add> @Override <ide> public Object proceed() throws Throwable { <ide> // We start with an index of -1 and increment early. <ide> if (this.currentInterceptorIndex == this.interceptorsAndDynamicMethodMatchers.size() - 1) { <ide> protected Object invokeJoinpoint() throws Throwable { <ide> * current interceptor index. <ide> * @see java.lang.Object#clone() <ide> */ <add> @Override <ide> public MethodInvocation invocableClone() { <ide> Object[] cloneArguments = null; <ide> if (this.arguments != null) { <ide> public MethodInvocation invocableClone() { <ide> * current interceptor index. <ide> * @see java.lang.Object#clone() <ide> */ <add> @Override <ide> public MethodInvocation invocableClone(Object[] arguments) { <ide> // Force initialization of the user attributes Map, <ide> // for having a shared Map reference in the clone. <ide> public MethodInvocation invocableClone(Object[] arguments) { <ide> } <ide> <ide> <add> @Override <ide> public void setUserAttribute(String key, Object value) { <ide> if (value != null) { <ide> if (this.userAttributes == null) { <ide> public void setUserAttribute(String key, Object value) { <ide> } <ide> } <ide> <add> @Override <ide> public Object getUserAttribute(String key) { <ide> return (this.userAttributes != null ? this.userAttributes.get(key) : null); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistrationManager.java <ide> public void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegis <ide> } <ide> <ide> <add> @Override <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { <ide> return bean; <ide> } <ide> <add> @Override <ide> public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { <ide> if (bean instanceof AdvisorAdapter){ <ide> this.advisorAdapterRegistry.registerAdvisorAdapter((AdvisorAdapter) bean); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceAdapter.java <ide> @SuppressWarnings("serial") <ide> class AfterReturningAdviceAdapter implements AdvisorAdapter, Serializable { <ide> <add> @Override <ide> public boolean supportsAdvice(Advice advice) { <ide> return (advice instanceof AfterReturningAdvice); <ide> } <ide> <add> @Override <ide> public MethodInterceptor getInterceptor(Advisor advisor) { <ide> AfterReturningAdvice advice = (AfterReturningAdvice) advisor.getAdvice(); <ide> return new AfterReturningAdviceInterceptor(advice); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/AfterReturningAdviceInterceptor.java <ide> public AfterReturningAdviceInterceptor(AfterReturningAdvice advice) { <ide> this.advice = advice; <ide> } <ide> <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> Object retVal = mi.proceed(); <ide> this.advice.afterReturning(retVal, mi.getMethod(), mi.getArguments(), mi.getThis()); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/DefaultAdvisorAdapterRegistry.java <ide> public DefaultAdvisorAdapterRegistry() { <ide> } <ide> <ide> <add> @Override <ide> public Advisor wrap(Object adviceObject) throws UnknownAdviceTypeException { <ide> if (adviceObject instanceof Advisor) { <ide> return (Advisor) adviceObject; <ide> public Advisor wrap(Object adviceObject) throws UnknownAdviceTypeException { <ide> throw new UnknownAdviceTypeException(advice); <ide> } <ide> <add> @Override <ide> public MethodInterceptor[] getInterceptors(Advisor advisor) throws UnknownAdviceTypeException { <ide> List<MethodInterceptor> interceptors = new ArrayList<MethodInterceptor>(3); <ide> Advice advice = advisor.getAdvice(); <ide> public MethodInterceptor[] getInterceptors(Advisor advisor) throws UnknownAdvice <ide> return interceptors.toArray(new MethodInterceptor[interceptors.size()]); <ide> } <ide> <add> @Override <ide> public void registerAdvisorAdapter(AdvisorAdapter adapter) { <ide> this.adapters.add(adapter); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceAdapter.java <ide> @SuppressWarnings("serial") <ide> class MethodBeforeAdviceAdapter implements AdvisorAdapter, Serializable { <ide> <add> @Override <ide> public boolean supportsAdvice(Advice advice) { <ide> return (advice instanceof MethodBeforeAdvice); <ide> } <ide> <add> @Override <ide> public MethodInterceptor getInterceptor(Advisor advisor) { <ide> MethodBeforeAdvice advice = (MethodBeforeAdvice) advisor.getAdvice(); <ide> return new MethodBeforeAdviceInterceptor(advice); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/MethodBeforeAdviceInterceptor.java <ide> public MethodBeforeAdviceInterceptor(MethodBeforeAdvice advice) { <ide> this.advice = advice; <ide> } <ide> <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> this.advice.before(mi.getMethod(), mi.getArguments(), mi.getThis() ); <ide> return mi.proceed(); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceAdapter.java <ide> @SuppressWarnings("serial") <ide> class ThrowsAdviceAdapter implements AdvisorAdapter, Serializable { <ide> <add> @Override <ide> public boolean supportsAdvice(Advice advice) { <ide> return (advice instanceof ThrowsAdvice); <ide> } <ide> <add> @Override <ide> public MethodInterceptor getInterceptor(Advisor advisor) { <ide> return new ThrowsAdviceInterceptor(advisor.getAdvice()); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptor.java <ide> private Method getExceptionHandler(Throwable exception) { <ide> return handler; <ide> } <ide> <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> try { <ide> return mi.proceed(); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java <ide> public final void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public final int getOrder() { <ide> return this.order; <ide> } <ide> public void setProxyClassLoader(ClassLoader classLoader) { <ide> this.classLoaderConfigured = (classLoader != null); <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader classLoader) { <ide> if (!this.classLoaderConfigured) { <ide> this.proxyClassLoader = classLoader; <ide> } <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> } <ide> protected BeanFactory getBeanFactory() { <ide> } <ide> <ide> <add> @Override <ide> public Class<?> predictBeanType(Class<?> beanClass, String beanName) { <ide> Object cacheKey = getCacheKey(beanClass, beanName); <ide> return this.proxyTypes.get(cacheKey); <ide> } <ide> <add> @Override <ide> public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, String beanName) throws BeansException { <ide> return null; <ide> } <ide> <add> @Override <ide> public Object getEarlyBeanReference(Object bean, String beanName) throws BeansException { <ide> Object cacheKey = getCacheKey(bean.getClass(), beanName); <ide> this.earlyProxyReferences.add(cacheKey); <ide> return wrapIfNecessary(bean, beanName, cacheKey); <ide> } <ide> <add> @Override <ide> public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException { <ide> Object cacheKey = getCacheKey(beanClass, beanName); <ide> <ide> public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName <ide> return null; <ide> } <ide> <add> @Override <ide> public boolean postProcessAfterInstantiation(Object bean, String beanName) { <ide> return true; <ide> } <ide> <add> @Override <ide> public PropertyValues postProcessPropertyValues( <ide> PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) { <ide> <ide> return pvs; <ide> } <ide> <add> @Override <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) { <ide> return bean; <ide> } <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) { <ide> * identified as one to proxy by the subclass. <ide> * @see #getAdvicesAndAdvisorsForBean <ide> */ <add> @Override <ide> public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { <ide> if (bean != null) { <ide> Object cacheKey = getCacheKey(bean.getClass(), beanName); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java <ide> public String getAdvisorBeanNamePrefix() { <ide> return this.advisorBeanNamePrefix; <ide> } <ide> <add> @Override <ide> public void setBeanName(String name) { <ide> // If no infrastructure bean name prefix has been set, override it. <ide> if (this.advisorBeanNamePrefix == null) { <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/AbstractBeanFactoryBasedTargetSourceCreator.java <ide> new HashMap<String, DefaultListableBeanFactory>(); <ide> <ide> <add> @Override <ide> public final void setBeanFactory(BeanFactory beanFactory) { <ide> if (!(beanFactory instanceof ConfigurableBeanFactory)) { <ide> throw new IllegalStateException("Cannot do auto-TargetSource creation with a BeanFactory " + <ide> protected final BeanFactory getBeanFactory() { <ide> // Implementation of the TargetSourceCreator interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public final TargetSource getTargetSource(Class<?> beanClass, String beanName) { <ide> AbstractBeanFactoryBasedTargetSource targetSource = <ide> createBeanFactoryBasedTargetSource(beanClass, beanName); <ide> protected DefaultListableBeanFactory buildInternalBeanFactory(ConfigurableBeanFa <ide> * Destroys the internal BeanFactory on shutdown of the TargetSourceCreator. <ide> * @see #getInternalBeanFactoryForBean <ide> */ <add> @Override <ide> public void destroy() { <ide> synchronized (this.internalBeanFactories) { <ide> for (DefaultListableBeanFactory bf : this.internalBeanFactories.values()) { <ide><path>spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java <ide> public void setHideProxyClassNames(boolean hideProxyClassNames) { <ide> * to the {@code invokeUnderTrace} method for handling. <ide> * @see #invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log) <ide> */ <add> @Override <ide> public Object invoke(MethodInvocation invocation) throws Throwable { <ide> Log logger = getLoggerForInvocation(invocation); <ide> if (isInterceptorEnabled(invocation, logger)) { <ide><path>spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java <ide> public void setExecutor(Executor defaultExecutor) { <ide> /** <ide> * Set the {@link BeanFactory} to be used when looking up executors by qualifier. <ide> */ <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) throws BeansException { <ide> this.beanFactory = beanFactory; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java <ide> public AsyncExecutionInterceptor(Executor executor) { <ide> * @return {@link Future} if the original method returns {@code Future}; {@code null} <ide> * otherwise. <ide> */ <add> @Override <ide> public Object invoke(final MethodInvocation invocation) throws Throwable { <ide> Class<?> targetClass = (invocation.getThis() != null ? AopUtils.getTargetClass(invocation.getThis()) : null); <ide> Method specificMethod = ClassUtils.getMostSpecificMethod(invocation.getMethod(), targetClass); <ide> specificMethod = BridgeMethodResolver.findBridgedMethod(specificMethod); <ide> <ide> Future<?> result = determineAsyncExecutor(specificMethod).submit( <ide> new Callable<Object>() { <add> @Override <ide> public Object call() throws Exception { <ide> try { <ide> Object result = invocation.proceed(); <ide> protected String getExecutorQualifier(Method method) { <ide> return null; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return Ordered.HIGHEST_PRECEDENCE; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptor.java <ide> public ConcurrencyThrottleInterceptor() { <ide> setConcurrencyLimit(1); <ide> } <ide> <add> @Override <ide> public Object invoke(MethodInvocation methodInvocation) throws Throwable { <ide> beforeAccess(); <ide> try { <ide><path>spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisors.java <ide> public ExposeBeanNameInterceptor(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> if (!(mi instanceof ProxyMethodInvocation)) { <ide> throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi); <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> return super.invoke(mi); <ide> } <ide> <add> @Override <ide> public String getBeanName() { <ide> return this.beanName; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeInvocationInterceptor.java <ide> public static MethodInvocation currentInvocation() throws IllegalStateException <ide> private ExposeInvocationInterceptor() { <ide> } <ide> <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> MethodInvocation oldInvocation = invocation.get(); <ide> invocation.set(mi); <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> } <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return Ordered.HIGHEST_PRECEDENCE + 1; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/scope/DefaultScopedObject.java <ide> public DefaultScopedObject(ConfigurableBeanFactory beanFactory, String targetBea <ide> } <ide> <ide> <add> @Override <ide> public Object getTargetObject() { <ide> return this.beanFactory.getBean(this.targetBeanName); <ide> } <ide> <add> @Override <ide> public void removeFromScope() { <ide> this.beanFactory.destroyScopedBean(this.targetBeanName); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyFactoryBean.java <ide> public void setTargetBeanName(String targetBeanName) { <ide> this.scopedTargetSource.setTargetBeanName(targetBeanName); <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> if (!(beanFactory instanceof ConfigurableBeanFactory)) { <ide> throw new IllegalStateException("Not running in a ConfigurableBeanFactory: " + beanFactory); <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> } <ide> <ide> <add> @Override <ide> public Object getObject() { <ide> if (this.proxy == null) { <ide> throw new FactoryBeanNotInitializedException(); <ide> } <ide> return this.proxy; <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> if (this.proxy != null) { <ide> return this.proxy.getClass(); <ide> public Class<?> getObjectType() { <ide> return null; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/AbstractBeanFactoryPointcutAdvisor.java <ide> public String getAdviceBeanName() { <ide> return this.adviceBeanName; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> } <ide> public void setAdvice(Advice advice) { <ide> } <ide> } <ide> <add> @Override <ide> public Advice getAdvice() { <ide> synchronized (this.adviceMonitor) { <ide> if (this.advice == null && this.adviceBeanName != null) { <ide><path>spring-aop/src/main/java/org/springframework/aop/support/AbstractExpressionPointcut.java <ide> protected void onSetExpression(String expression) throws IllegalArgumentExceptio <ide> /** <ide> * Return this pointcut's expression. <ide> */ <add> @Override <ide> public String getExpression() { <ide> return this.expression; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/AbstractGenericPointcutAdvisor.java <ide> public void setAdvice(Advice advice) { <ide> this.advice = advice; <ide> } <ide> <add> @Override <ide> public Advice getAdvice() { <ide> return this.advice; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/AbstractPointcutAdvisor.java <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> if (this.order != null) { <ide> return this.order; <ide> public int getOrder() { <ide> return Ordered.LOWEST_PRECEDENCE; <ide> } <ide> <add> @Override <ide> public boolean isPerInstance() { <ide> return true; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/AbstractRegexpMethodPointcut.java <ide> public String[] getExcludedPatterns() { <ide> * of the target class as well as against the method's declaring class, <ide> * plus the name of the method. <ide> */ <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> return ((targetClass != null && matchesPattern(targetClass.getName() + "." + method.getName())) || <ide> matchesPattern(method.getDeclaringClass().getName() + "." + method.getName())); <ide><path>spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java <ide> public UnionClassFilter(ClassFilter[] filters) { <ide> this.filters = filters; <ide> } <ide> <add> @Override <ide> public boolean matches(Class clazz) { <ide> for (int i = 0; i < this.filters.length; i++) { <ide> if (this.filters[i].matches(clazz)) { <ide> public IntersectionClassFilter(ClassFilter[] filters) { <ide> this.filters = filters; <ide> } <ide> <add> @Override <ide> public boolean matches(Class clazz) { <ide> for (int i = 0; i < this.filters.length; i++) { <ide> if (!this.filters[i].matches(clazz)) { <ide><path>spring-aop/src/main/java/org/springframework/aop/support/ComposablePointcut.java <ide> public ComposablePointcut intersection(Pointcut other) { <ide> } <ide> <ide> <add> @Override <ide> public ClassFilter getClassFilter() { <ide> return this.classFilter; <ide> } <ide> <add> @Override <ide> public MethodMatcher getMethodMatcher() { <ide> return this.methodMatcher; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/ControlFlowPointcut.java <ide> public ControlFlowPointcut(Class clazz, String methodName) { <ide> /** <ide> * Subclasses can override this for greater filtering (and performance). <ide> */ <add> @Override <ide> public boolean matches(Class clazz) { <ide> return true; <ide> } <ide> public boolean matches(Class clazz) { <ide> * Subclasses can override this if it's possible to filter out <ide> * some candidate classes. <ide> */ <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> return true; <ide> } <ide> <add> @Override <ide> public boolean isRuntime() { <ide> return true; <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass, Object[] args) { <ide> ++this.evaluations; <ide> ControlFlow cflow = ControlFlowFactory.createControlFlow(); <ide> public int getEvaluations() { <ide> } <ide> <ide> <add> @Override <ide> public ClassFilter getClassFilter() { <ide> return this; <ide> } <ide> <add> @Override <ide> public MethodMatcher getMethodMatcher() { <ide> return this; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/DefaultBeanFactoryPointcutAdvisor.java <ide> public void setPointcut(Pointcut pointcut) { <ide> this.pointcut = (pointcut != null ? pointcut : Pointcut.TRUE); <ide> } <ide> <add> @Override <ide> public Pointcut getPointcut() { <ide> return this.pointcut; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java <ide> public void addInterface(Class intf) { <ide> this.interfaces.add(intf); <ide> } <ide> <add> @Override <ide> public Class[] getInterfaces() { <ide> return this.interfaces.toArray(new Class[this.interfaces.size()]); <ide> } <ide> <add> @Override <ide> public void validateInterfaces() throws IllegalArgumentException { <ide> for (Class ifc : this.interfaces) { <ide> if (this.advice instanceof DynamicIntroductionAdvice && <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> <ide> <add> @Override <ide> public Advice getAdvice() { <ide> return this.advice; <ide> } <ide> <add> @Override <ide> public boolean isPerInstance() { <ide> return true; <ide> } <ide> <add> @Override <ide> public ClassFilter getClassFilter() { <ide> return this; <ide> } <ide> <add> @Override <ide> public boolean matches(Class clazz) { <ide> return true; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/DefaultPointcutAdvisor.java <ide> public void setPointcut(Pointcut pointcut) { <ide> this.pointcut = (pointcut != null ? pointcut : Pointcut.TRUE); <ide> } <ide> <add> @Override <ide> public Pointcut getPointcut() { <ide> return this.pointcut; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java <ide> public DelegatePerTargetObjectIntroductionInterceptor(Class defaultImplType, Cla <ide> * behaviour in around advice. However, subclasses should invoke this <ide> * method, which handles introduced interfaces and forwarding to the target. <ide> */ <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> if (isMethodOnIntroducedInterface(mi)) { <ide> Object delegate = getIntroductionDelegateFor(mi.getThis()); <ide><path>spring-aop/src/main/java/org/springframework/aop/support/DelegatingIntroductionInterceptor.java <ide> private void init(Object delegate) { <ide> * behaviour in around advice. However, subclasses should invoke this <ide> * method, which handles introduced interfaces and forwarding to the target. <ide> */ <add> @Override <ide> public Object invoke(MethodInvocation mi) throws Throwable { <ide> if (isMethodOnIntroducedInterface(mi)) { <ide> // Using the following method rather than direct reflection, we <ide><path>spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcher.java <ide> */ <ide> public abstract class DynamicMethodMatcher implements MethodMatcher { <ide> <add> @Override <ide> public final boolean isRuntime() { <ide> return true; <ide> } <ide> public final boolean isRuntime() { <ide> * Can override to add preconditions for dynamic matching. This implementation <ide> * always returns true. <ide> */ <add> @Override <ide> public boolean matches(Method method, Class<?> targetClass) { <ide> return true; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcherPointcut.java <ide> */ <ide> public abstract class DynamicMethodMatcherPointcut extends DynamicMethodMatcher implements Pointcut { <ide> <add> @Override <ide> public ClassFilter getClassFilter() { <ide> return ClassFilter.TRUE; <ide> } <ide> <add> @Override <ide> public final MethodMatcher getMethodMatcher() { <ide> return this; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java <ide> public void suppressInterface(Class intf) { <ide> this.publishedInterfaces.remove(intf); <ide> } <ide> <add> @Override <ide> public Class[] getInterfaces() { <ide> return this.publishedInterfaces.toArray(new Class[this.publishedInterfaces.size()]); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java <ide> public UnionMethodMatcher(MethodMatcher mm1, MethodMatcher mm2) { <ide> this.mm2 = mm2; <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass, boolean hasIntroductions) { <ide> return (matchesClass1(targetClass) && MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions)) || <ide> (matchesClass2(targetClass) && MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions)); <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> return (matchesClass1(targetClass) && this.mm1.matches(method, targetClass)) || <ide> (matchesClass2(targetClass) && this.mm2.matches(method, targetClass)); <ide> protected boolean matchesClass2(Class targetClass) { <ide> return true; <ide> } <ide> <add> @Override <ide> public boolean isRuntime() { <ide> return this.mm1.isRuntime() || this.mm2.isRuntime(); <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass, Object[] args) { <ide> return this.mm1.matches(method, targetClass, args) || this.mm2.matches(method, targetClass, args); <ide> } <ide> public IntersectionMethodMatcher(MethodMatcher mm1, MethodMatcher mm2) { <ide> this.mm2 = mm2; <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass, boolean hasIntroductions) { <ide> return MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions) && <ide> MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions); <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> return this.mm1.matches(method, targetClass) && this.mm2.matches(method, targetClass); <ide> } <ide> <add> @Override <ide> public boolean isRuntime() { <ide> return this.mm1.isRuntime() || this.mm2.isRuntime(); <ide> } <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass, Object[] args) { <ide> // Because a dynamic intersection may be composed of a static and dynamic part, <ide> // we must avoid calling the 3-arg matches method on a dynamic matcher, as <ide><path>spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java <ide> public NameMatchMethodPointcut addMethodName(String name) { <ide> } <ide> <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> for (String mappedName : this.mappedNames) { <ide> if (mappedName.equals(method.getName()) || isMatch(method.getName(), mappedName)) { <ide><path>spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcutAdvisor.java <ide> public NameMatchMethodPointcut addMethodName(String name) { <ide> } <ide> <ide> <add> @Override <ide> public Pointcut getPointcut() { <ide> return this.pointcut; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java <ide> private static class SetterPointcut extends StaticMethodMatcherPointcut implemen <ide> <ide> public static SetterPointcut INSTANCE = new SetterPointcut(); <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> return method.getName().startsWith("set") && <ide> method.getParameterTypes().length == 1 && <ide> private static class GetterPointcut extends StaticMethodMatcherPointcut implemen <ide> <ide> public static GetterPointcut INSTANCE = new GetterPointcut(); <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> return method.getName().startsWith("get") && <ide> method.getParameterTypes().length == 0; <ide><path>spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java <ide> public void setPatterns(String[] patterns) { <ide> /** <ide> * Initialize the singleton Pointcut held within this Advisor. <ide> */ <add> @Override <ide> public Pointcut getPointcut() { <ide> synchronized (this.pointcutMonitor) { <ide> if (this.pointcut == null) { <ide><path>spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java <ide> public RootClassFilter(Class clazz) { <ide> this.clazz = clazz; <ide> } <ide> <add> @Override <ide> public boolean matches(Class candidate) { <ide> return clazz.isAssignableFrom(candidate); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcher.java <ide> */ <ide> public abstract class StaticMethodMatcher implements MethodMatcher { <ide> <add> @Override <ide> public final boolean isRuntime() { <ide> return false; <ide> } <ide> <add> @Override <ide> public final boolean matches(Method method, Class<?> targetClass, Object[] args) { <ide> // should never be invoked because isRuntime() returns false <ide> throw new UnsupportedOperationException("Illegal MethodMatcher usage"); <ide><path>spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcherPointcut.java <ide> public void setClassFilter(ClassFilter classFilter) { <ide> this.classFilter = classFilter; <ide> } <ide> <add> @Override <ide> public ClassFilter getClassFilter() { <ide> return this.classFilter; <ide> } <ide> <ide> <add> @Override <ide> public final MethodMatcher getMethodMatcher() { <ide> return this; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcherPointcutAdvisor.java <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> public void setAdvice(Advice advice) { <ide> this.advice = advice; <ide> } <ide> <add> @Override <ide> public Advice getAdvice() { <ide> return this.advice; <ide> } <ide> <add> @Override <ide> public boolean isPerInstance() { <ide> return true; <ide> } <ide> <add> @Override <ide> public Pointcut getPointcut() { <ide> return this; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationClassFilter.java <ide> public AnnotationClassFilter(Class<? extends Annotation> annotationType, boolean <ide> } <ide> <ide> <add> @Override <ide> public boolean matches(Class clazz) { <ide> return (this.checkInherited ? <ide> (AnnotationUtils.findAnnotation(clazz, this.annotationType) != null) : <ide><path>spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMatchingPointcut.java <ide> public AnnotationMatchingPointcut( <ide> } <ide> <ide> <add> @Override <ide> public ClassFilter getClassFilter() { <ide> return this.classFilter; <ide> } <ide> <add> @Override <ide> public MethodMatcher getMethodMatcher() { <ide> return this.methodMatcher; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMethodMatcher.java <ide> public AnnotationMethodMatcher(Class<? extends Annotation> annotationType) { <ide> } <ide> <ide> <add> @Override <ide> public boolean matches(Method method, Class targetClass) { <ide> if (method.isAnnotationPresent(this.annotationType)) { <ide> return true; <ide><path>spring-aop/src/main/java/org/springframework/aop/target/AbstractBeanFactoryBasedTargetSource.java <ide> public void setTargetClass(Class targetClass) { <ide> * Set the owning BeanFactory. We need to save a reference so that we can <ide> * use the {@code getBean} method on every invocation. <ide> */ <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> if (this.targetBeanName == null) { <ide> throw new IllegalStateException("Property'targetBeanName' is required"); <ide> public BeanFactory getBeanFactory() { <ide> } <ide> <ide> <add> @Override <ide> public synchronized Class<?> getTargetClass() { <ide> if (this.targetClass == null && this.beanFactory != null) { <ide> // Determine type of the target bean. <ide> public synchronized Class<?> getTargetClass() { <ide> return this.targetClass; <ide> } <ide> <add> @Override <ide> public boolean isStatic() { <ide> return false; <ide> } <ide> <add> @Override <ide> public void releaseTarget(Object target) throws Exception { <ide> // Nothing to do here. <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/target/AbstractLazyCreationTargetSource.java <ide> public synchronized boolean isInitialized() { <ide> * a meaningful value when the target is still {@code null}. <ide> * @see #isInitialized() <ide> */ <add> @Override <ide> public synchronized Class<?> getTargetClass() { <ide> return (this.lazyTarget != null ? this.lazyTarget.getClass() : null); <ide> } <ide> <add> @Override <ide> public boolean isStatic() { <ide> return false; <ide> } <ide> public boolean isStatic() { <ide> * creating it on-the-fly if it doesn't exist already. <ide> * @see #createObject() <ide> */ <add> @Override <ide> public synchronized Object getTarget() throws Exception { <ide> if (this.lazyTarget == null) { <ide> logger.debug("Initializing lazy target object"); <ide> public synchronized Object getTarget() throws Exception { <ide> return this.lazyTarget; <ide> } <ide> <add> @Override <ide> public void releaseTarget(Object target) throws Exception { <ide> // nothing to do <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java <ide> public void setMaxSize(int maxSize) { <ide> /** <ide> * Return the maximum size of the pool. <ide> */ <add> @Override <ide> public int getMaxSize() { <ide> return this.maxSize; <ide> } <ide> public final void setBeanFactory(BeanFactory beanFactory) throws BeansException <ide> * @throws Exception we may need to deal with checked exceptions from pool <ide> * APIs, so we're forgiving with our exception signature <ide> */ <add> @Override <ide> public abstract Object getTarget() throws Exception; <ide> <ide> /** <ide><path>spring-aop/src/main/java/org/springframework/aop/target/CommonsPoolTargetSource.java <ide> public void releaseTarget(Object target) throws Exception { <ide> this.pool.returnObject(target); <ide> } <ide> <add> @Override <ide> public int getActiveCount() throws UnsupportedOperationException { <ide> return this.pool.getNumActive(); <ide> } <ide> <add> @Override <ide> public int getIdleCount() throws UnsupportedOperationException { <ide> return this.pool.getNumIdle(); <ide> } <ide> public int getIdleCount() throws UnsupportedOperationException { <ide> /** <ide> * Closes the underlying {@code ObjectPool} when destroying this object. <ide> */ <add> @Override <ide> public void destroy() throws Exception { <ide> logger.debug("Closing Commons ObjectPool"); <ide> this.pool.close(); <ide> public void destroy() throws Exception { <ide> // Implementation of org.apache.commons.pool.PoolableObjectFactory interface <ide> //---------------------------------------------------------------------------- <ide> <add> @Override <ide> public Object makeObject() throws BeansException { <ide> return newPrototypeInstance(); <ide> } <ide> <add> @Override <ide> public void destroyObject(Object obj) throws Exception { <ide> destroyPrototypeInstance(obj); <ide> } <ide> <add> @Override <ide> public boolean validateObject(Object obj) { <ide> return true; <ide> } <ide> <add> @Override <ide> public void activateObject(Object obj) { <ide> } <ide> <add> @Override <ide> public void passivateObject(Object obj) { <ide> } <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java <ide> private EmptyTargetSource(Class targetClass, boolean isStatic) { <ide> /** <ide> * Always returns the specified target Class, or {@code null} if none. <ide> */ <add> @Override <ide> public Class<?> getTargetClass() { <ide> return this.targetClass; <ide> } <ide> <ide> /** <ide> * Always returns {@code true}. <ide> */ <add> @Override <ide> public boolean isStatic() { <ide> return this.isStatic; <ide> } <ide> <ide> /** <ide> * Always returns {@code null}. <ide> */ <add> @Override <ide> public Object getTarget() { <ide> return null; <ide> } <ide> <ide> /** <ide> * Nothing to release. <ide> */ <add> @Override <ide> public void releaseTarget(Object target) { <ide> } <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/target/HotSwappableTargetSource.java <ide> public HotSwappableTargetSource(Object initialTarget) { <ide> * Return the type of the current target object. <ide> * <p>The returned type should usually be constant across all target objects. <ide> */ <add> @Override <ide> public synchronized Class<?> getTargetClass() { <ide> return this.target.getClass(); <ide> } <ide> <add> @Override <ide> public final boolean isStatic() { <ide> return false; <ide> } <ide> <add> @Override <ide> public synchronized Object getTarget() { <ide> return this.target; <ide> } <ide> <add> @Override <ide> public void releaseTarget(Object target) { <ide> // nothing to do <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/target/LazyInitTargetSource.java <ide> public class LazyInitTargetSource extends AbstractBeanFactoryBasedTargetSource { <ide> private Object target; <ide> <ide> <add> @Override <ide> public synchronized Object getTarget() throws BeansException { <ide> if (this.target == null) { <ide> this.target = getBeanFactory().getBean(getTargetBeanName()); <ide><path>spring-aop/src/main/java/org/springframework/aop/target/PrototypeTargetSource.java <ide> public class PrototypeTargetSource extends AbstractPrototypeBasedTargetSource { <ide> * Obtain a new prototype instance for every call. <ide> * @see #newPrototypeInstance() <ide> */ <add> @Override <ide> public Object getTarget() throws BeansException { <ide> return newPrototypeInstance(); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/target/SimpleBeanTargetSource.java <ide> @SuppressWarnings("serial") <ide> public class SimpleBeanTargetSource extends AbstractBeanFactoryBasedTargetSource { <ide> <add> @Override <ide> public Object getTarget() throws Exception { <ide> return getBeanFactory().getBean(getTargetBeanName()); <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/target/SingletonTargetSource.java <ide> public SingletonTargetSource(Object target) { <ide> } <ide> <ide> <add> @Override <ide> public Class<?> getTargetClass() { <ide> return this.target.getClass(); <ide> } <ide> <add> @Override <ide> public Object getTarget() { <ide> return this.target; <ide> } <ide> <add> @Override <ide> public void releaseTarget(Object target) { <ide> // nothing to do <ide> } <ide> <add> @Override <ide> public boolean isStatic() { <ide> return true; <ide> } <ide><path>spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSource.java <ide> public class ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource <ide> * We look for a target held in a ThreadLocal. If we don't find one, <ide> * we create one and bind it to the thread. No synchronization is required. <ide> */ <add> @Override <ide> public Object getTarget() throws BeansException { <ide> ++this.invocationCount; <ide> Object target = this.targetInThread.get(); <ide> public Object getTarget() throws BeansException { <ide> * Dispose of targets if necessary; clear ThreadLocal. <ide> * @see #destroyPrototypeInstance <ide> */ <add> @Override <ide> public void destroy() { <ide> logger.debug("Destroying ThreadLocalTargetSource bindings"); <ide> synchronized (this.targetSet) { <ide> public void destroy() { <ide> } <ide> <ide> <add> @Override <ide> public int getInvocationCount() { <ide> return this.invocationCount; <ide> } <ide> <add> @Override <ide> public int getHitCount() { <ide> return this.hitCount; <ide> } <ide> <add> @Override <ide> public int getObjectCount() { <ide> synchronized (this.targetSet) { <ide> return this.targetSet.size(); <ide><path>spring-aop/src/main/java/org/springframework/aop/target/dynamic/AbstractRefreshableTargetSource.java <ide> public void setRefreshCheckDelay(long refreshCheckDelay) { <ide> } <ide> <ide> <add> @Override <ide> public synchronized Class<?> getTargetClass() { <ide> if (this.targetObject == null) { <ide> refresh(); <ide> public synchronized Class<?> getTargetClass() { <ide> /** <ide> * Not static. <ide> */ <add> @Override <ide> public boolean isStatic() { <ide> return false; <ide> } <ide> <add> @Override <ide> public final synchronized Object getTarget() { <ide> if ((refreshCheckDelayElapsed() && requiresRefresh()) || this.targetObject == null) { <ide> refresh(); <ide> public final synchronized Object getTarget() { <ide> /** <ide> * No need to release target. <ide> */ <add> @Override <ide> public void releaseTarget(Object object) { <ide> } <ide> <ide> <add> @Override <ide> public final synchronized void refresh() { <ide> logger.debug("Attempting to refresh target"); <ide> <ide> public final synchronized void refresh() { <ide> logger.debug("Target refreshed successfully"); <ide> } <ide> <add> @Override <ide> public synchronized long getRefreshCount() { <ide> return this.refreshCount; <ide> } <ide> <add> @Override <ide> public synchronized long getLastRefreshTime() { <ide> return this.lastRefreshTime; <ide> } <ide><path>spring-aop/src/test/java/org/springframework/aop/framework/MethodInvocationTests.java <ide> public Object invoke(MethodInvocation invocation) throws Throwable { <ide> @Test <ide> public void testToStringDoesntHitTarget() throws Throwable { <ide> Object target = new TestBean() { <add> @Override <ide> public String toString() { <ide> throw new UnsupportedOperationException("toString"); <ide> } <ide><path>spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java <ide> public void testIntroductionInterceptorDoesntReplaceToString() throws Exception <ide> TimeStamped ts = new SerializableTimeStamped(0); <ide> <ide> factory.addAdvisor(0, new DefaultIntroductionAdvisor(new DelegatingIntroductionInterceptor(ts) { <add> @Override <ide> public String toString() { <ide> throw new UnsupportedOperationException("Shouldn't be invoked"); <ide> } <ide><path>spring-aop/src/test/java/org/springframework/tests/aop/advice/MethodCounter.java <ide> public int getCalls() { <ide> * Doesn't worry about counts. <ide> * @see java.lang.Object#equals(java.lang.Object) <ide> */ <add> @Override <ide> public boolean equals(Object other) { <ide> return (other != null && other.getClass() == this.getClass()); <ide> } <ide> <add> @Override <ide> public int hashCode() { <ide> return getClass().hashCode(); <ide> } <ide><path>spring-aop/src/test/java/org/springframework/tests/aop/interceptor/NopInterceptor.java <ide> protected void increment() { <ide> ++count; <ide> } <ide> <add> @Override <ide> public boolean equals(Object other) { <ide> if (!(other instanceof NopInterceptor)) { <ide> return false; <ide><path>spring-aop/src/test/java/org/springframework/tests/sample/beans/SerializablePerson.java <ide> public Object echo(Object o) throws Throwable { <ide> return o; <ide> } <ide> <add> @Override <ide> public boolean equals(Object other) { <ide> if (!(other instanceof SerializablePerson)) { <ide> return false; <ide><path>spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerTests.java <ide> public CircularFactoryBean() { <ide> assertNull(autowired.getRamnivas()); <ide> } <ide> <add> @Override <ide> public Object getObject() throws Exception { <ide> return new TestBean(); <ide> } <ide> <add> @Override <ide> public Class getObjectType() { <ide> return TestBean.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return false; <ide> } <ide> public static class PricingStrategy { <ide> public static class LineItem implements PricingStrategyClient { <ide> private PricingStrategy pricingStrategy; <ide> <add> @Override <ide> public void setPricingStrategy(PricingStrategy pricingStrategy) { <ide> this.pricingStrategy = pricingStrategy; <ide> } <ide> public void setPricingStrategy(PricingStrategy pricingStrategy) { <ide> public static class Order implements MailSenderClient, Serializable { <ide> private transient MailSender mailSender; <ide> <add> @Override <ide> public void setMailSender(MailSender mailSender) { <ide> this.mailSender = mailSender; <ide> } <ide> public static class ShoppingCart implements MailSenderClient, PaymentProcessorCl <ide> private transient MailSender mailSender; <ide> private transient PaymentProcessor paymentProcessor; <ide> <add> @Override <ide> public void setMailSender(MailSender mailSender) { <ide> this.mailSender = mailSender; <ide> } <ide> <add> @Override <ide> public void setPaymentProcessor(PaymentProcessor paymentProcessor) { <ide> this.paymentProcessor = paymentProcessor; <ide> } <ide><path>spring-aspects/src/test/java/org/springframework/cache/aspectj/AspectJAnnotationTests.java <ide> public void testKeyStrategy() throws Exception { <ide> Assert.assertSame(ctx.getBean("keyGenerator"), aspect.getKeyGenerator()); <ide> } <ide> <add> @Override <ide> public void testMultiEvict(CacheableService<?> service) { <ide> Object o1 = new Object(); <ide> <ide><path>spring-aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java <ide> public class AnnotatedClassCacheableService implements CacheableService<Object> <ide> private final AtomicLong counter = new AtomicLong(); <ide> public static final AtomicLong nullInvocations = new AtomicLong(); <ide> <add> @Override <ide> public Object cache(Object arg1) { <ide> return counter.getAndIncrement(); <ide> } <ide> <add> @Override <ide> public Object conditional(int field) { <ide> return null; <ide> } <ide> <add> @Override <ide> public Object unless(int arg) { <ide> return arg; <ide> } <ide> <add> @Override <ide> @CacheEvict("default") <ide> public void invalidate(Object arg1) { <ide> } <ide> <add> @Override <ide> @CacheEvict("default") <ide> public void evictWithException(Object arg1) { <ide> throw new RuntimeException("exception thrown - evict should NOT occur"); <ide> } <ide> <add> @Override <ide> @CacheEvict(value = "default", allEntries = true) <ide> public void evictAll(Object arg1) { <ide> } <ide> <add> @Override <ide> @CacheEvict(value = "default", beforeInvocation = true) <ide> public void evictEarly(Object arg1) { <ide> throw new RuntimeException("exception thrown - evict should still occur"); <ide> } <ide> <add> @Override <ide> @CacheEvict(value = "default", key = "#p0") <ide> public void evict(Object arg1, Object arg2) { <ide> } <ide> <add> @Override <ide> @CacheEvict(value = "default", key = "#p0", beforeInvocation = true) <ide> public void invalidateEarly(Object arg1, Object arg2) { <ide> throw new RuntimeException("exception thrown - evict should still occur"); <ide> } <ide> <add> @Override <ide> @Cacheable(value = "default", key = "#p0") <ide> public Object key(Object arg1, Object arg2) { <ide> return counter.getAndIncrement(); <ide> } <ide> <add> @Override <ide> @Cacheable(value = "default", key = "#root.methodName + #root.caches[0].name") <ide> public Object name(Object arg1) { <ide> return counter.getAndIncrement(); <ide> } <ide> <add> @Override <ide> @Cacheable(value = "default", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target") <ide> public Object rootVars(Object arg1) { <ide> return counter.getAndIncrement(); <ide> } <ide> <add> @Override <ide> @CachePut("default") <ide> public Object update(Object arg1) { <ide> return counter.getAndIncrement(); <ide> } <ide> <add> @Override <ide> @CachePut(value = "default", condition = "#arg.equals(3)") <ide> public Object conditionalUpdate(Object arg) { <ide> return arg; <ide> } <ide> <add> @Override <ide> public Object nullValue(Object arg1) { <ide> nullInvocations.incrementAndGet(); <ide> return null; <ide> } <ide> <add> @Override <ide> public Number nullInvocations() { <ide> return nullInvocations.get(); <ide> } <ide> <add> @Override <ide> public Long throwChecked(Object arg1) throws Exception { <ide> throw new UnsupportedOperationException(arg1.toString()); <ide> } <ide> <add> @Override <ide> public Long throwUnchecked(Object arg1) { <ide> throw new UnsupportedOperationException(); <ide> } <ide> <ide> // multi annotations <ide> <add> @Override <ide> @Caching(cacheable = { @Cacheable("primary"), @Cacheable("secondary") }) <ide> public Object multiCache(Object arg1) { <ide> return counter.getAndIncrement(); <ide> } <ide> <add> @Override <ide> @Caching(evict = { @CacheEvict("primary"), @CacheEvict(value = "secondary", key = "#p0") }) <ide> public Object multiEvict(Object arg1) { <ide> return counter.getAndIncrement(); <ide> } <ide> <add> @Override <ide> @Caching(cacheable = { @Cacheable(value = "primary", key = "#root.methodName") }, evict = { @CacheEvict("secondary") }) <ide> public Object multiCacheAndEvict(Object arg1) { <ide> return counter.getAndIncrement(); <ide> } <ide> <add> @Override <ide> @Caching(cacheable = { @Cacheable(value = "primary", condition = "#p0 == 3") }, evict = { @CacheEvict("secondary") }) <ide> public Object multiConditionalCacheAndEvict(Object arg1) { <ide> return counter.getAndIncrement(); <ide> } <ide> <add> @Override <ide> @Caching(put = { @CachePut("primary"), @CachePut("secondary") }) <ide> public Object multiUpdate(Object arg1) { <ide> return arg1; <ide><path>spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests.java <ide> public void testDefaultCommitOnAnnotatedClass() throws Throwable { <ide> final Exception ex = new Exception(); <ide> try { <ide> testRollback(new TransactionOperationCallback() { <add> @Override <ide> public Object performTransactionalOperation() throws Throwable { <ide> return annotationOnlyOnClassWithNoInterface.echo(ex); <ide> } <ide> public void testDefaultRollbackOnAnnotatedClass() throws Throwable { <ide> final RuntimeException ex = new RuntimeException(); <ide> try { <ide> testRollback(new TransactionOperationCallback() { <add> @Override <ide> public Object performTransactionalOperation() throws Throwable { <ide> return annotationOnlyOnClassWithNoInterface.echo(ex); <ide> } <ide> public void testDefaultCommitOnSubclassOfAnnotatedClass() throws Throwable { <ide> final Exception ex = new Exception(); <ide> try { <ide> testRollback(new TransactionOperationCallback() { <add> @Override <ide> public Object performTransactionalOperation() throws Throwable { <ide> return new SubclassOfClassWithTransactionalAnnotation().echo(ex); <ide> } <ide> public void testDefaultCommitOnSubclassOfClassWithTransactionalMethodAnnotated() <ide> final Exception ex = new Exception(); <ide> try { <ide> testRollback(new TransactionOperationCallback() { <add> @Override <ide> public Object performTransactionalOperation() throws Throwable { <ide> return new SubclassOfClassWithTransactionalMethodAnnotation().echo(ex); <ide> } <ide> public void testDefaultCommitOnImplementationOfAnnotatedInterface() throws Throw <ide> <ide> final Exception ex = new Exception(); <ide> testNotTransactional(new TransactionOperationCallback() { <add> @Override <ide> public Object performTransactionalOperation() throws Throwable { <ide> return new ImplementsAnnotatedInterface().echo(ex); <ide> } <ide> public void testDefaultRollbackOnImplementationOfAnnotatedInterface() throws Thr <ide> <ide> final Exception rollbackProvokingException = new RuntimeException(); <ide> testNotTransactional(new TransactionOperationCallback() { <add> @Override <ide> public Object performTransactionalOperation() throws Throwable { <ide> return new ImplementsAnnotatedInterface().echo(rollbackProvokingException); <ide> } <ide> public static class SubclassOfClassWithTransactionalMethodAnnotation extends Met <ide> <ide> public static class ImplementsAnnotatedInterface implements ITransactional { <ide> <add> @Override <ide> public Object echo(Throwable t) throws Throwable { <ide> if (t != null) { <ide> throw t; <ide><path>spring-beans/src/main/java/org/springframework/beans/AbstractPropertyAccessor.java <ide> public abstract class AbstractPropertyAccessor extends TypeConverterSupport impl <ide> private boolean extractOldValueForEditor = false; <ide> <ide> <add> @Override <ide> public void setExtractOldValueForEditor(boolean extractOldValueForEditor) { <ide> this.extractOldValueForEditor = extractOldValueForEditor; <ide> } <ide> <add> @Override <ide> public boolean isExtractOldValueForEditor() { <ide> return this.extractOldValueForEditor; <ide> } <ide> <ide> <add> @Override <ide> public void setPropertyValue(PropertyValue pv) throws BeansException { <ide> setPropertyValue(pv.getName(), pv.getValue()); <ide> } <ide> <add> @Override <ide> public void setPropertyValues(Map<?, ?> map) throws BeansException { <ide> setPropertyValues(new MutablePropertyValues(map)); <ide> } <ide> <add> @Override <ide> public void setPropertyValues(PropertyValues pvs) throws BeansException { <ide> setPropertyValues(pvs, false, false); <ide> } <ide> <add> @Override <ide> public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown) throws BeansException { <ide> setPropertyValues(pvs, ignoreUnknown, false); <ide> } <ide> <add> @Override <ide> public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean ignoreInvalid) <ide> throws BeansException { <ide> <ide> public Class getPropertyType(String propertyPath) { <ide> * @throws PropertyAccessException if the property was valid but the <ide> * accessor method failed <ide> */ <add> @Override <ide> public abstract Object getPropertyValue(String propertyName) throws BeansException; <ide> <ide> /** <ide> public Class getPropertyType(String propertyPath) { <ide> * @throws PropertyAccessException if the property was valid but the <ide> * accessor method failed or a type mismatch occured <ide> */ <add> @Override <ide> public abstract void setPropertyValue(String propertyName, Object value) throws BeansException; <ide> <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttribute.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttributeAccessor.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java <ide> public void setWrappedInstance(Object object, String nestedPath, Object rootObje <ide> setIntrospectionClass(object.getClass()); <ide> } <ide> <add> @Override <ide> public final Object getWrappedInstance() { <ide> return this.object; <ide> } <ide> <add> @Override <ide> public final Class getWrappedClass() { <ide> return (this.object != null ? this.object.getClass() : null); <ide> } <ide> public final Class getRootClass() { <ide> * enables auto-growth of collection elements when accessing an out-of-bounds index. <ide> * <p>Default is "false" on a plain BeanWrapper. <ide> */ <add> @Override <ide> public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths) { <ide> this.autoGrowNestedPaths = autoGrowNestedPaths; <ide> } <ide> <ide> /** <ide> * Return whether "auto-growing" of nested paths has been activated. <ide> */ <add> @Override <ide> public boolean isAutoGrowNestedPaths() { <ide> return this.autoGrowNestedPaths; <ide> } <ide> public boolean isAutoGrowNestedPaths() { <ide> * Specify a limit for array and collection auto-growing. <ide> * <p>Default is unlimited on a plain BeanWrapper. <ide> */ <add> @Override <ide> public void setAutoGrowCollectionLimit(int autoGrowCollectionLimit) { <ide> this.autoGrowCollectionLimit = autoGrowCollectionLimit; <ide> } <ide> <ide> /** <ide> * Return the limit for array and collection auto-growing. <ide> */ <add> @Override <ide> public int getAutoGrowCollectionLimit() { <ide> return this.autoGrowCollectionLimit; <ide> } <ide> private CachedIntrospectionResults getCachedIntrospectionResults() { <ide> } <ide> <ide> <add> @Override <ide> public PropertyDescriptor[] getPropertyDescriptors() { <ide> return getCachedIntrospectionResults().getPropertyDescriptors(); <ide> } <ide> <add> @Override <ide> public PropertyDescriptor getPropertyDescriptor(String propertyName) throws BeansException { <ide> PropertyDescriptor pd = getPropertyDescriptorInternal(propertyName); <ide> if (pd == null) { <ide> public Class getPropertyType(String propertyName) throws BeansException { <ide> return null; <ide> } <ide> <add> @Override <ide> public TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws BeansException { <ide> try { <ide> BeanWrapperImpl nestedBw = getBeanWrapperForPropertyPath(propertyName); <ide> public TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws Bean <ide> return null; <ide> } <ide> <add> @Override <ide> public boolean isReadableProperty(String propertyName) { <ide> try { <ide> PropertyDescriptor pd = getPropertyDescriptorInternal(propertyName); <ide> public boolean isReadableProperty(String propertyName) { <ide> return false; <ide> } <ide> <add> @Override <ide> public boolean isWritableProperty(String propertyName) { <ide> try { <ide> PropertyDescriptor pd = getPropertyDescriptorInternal(propertyName); <ide> private Object getPropertyValue(PropertyTokenHolder tokens) throws BeansExceptio <ide> if (!Modifier.isPublic(readMethod.getDeclaringClass().getModifiers()) && !readMethod.isAccessible()) { <ide> if (System.getSecurityManager() != null) { <ide> AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> readMethod.setAccessible(true); <ide> return null; <ide> public Object run() { <ide> if (System.getSecurityManager() != null) { <ide> try { <ide> value = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { <add> @Override <ide> public Object run() throws Exception { <ide> return readMethod.invoke(object, (Object[]) null); <ide> } <ide> else if (propValue instanceof Map) { <ide> !readMethod.isAccessible()) { <ide> if (System.getSecurityManager()!= null) { <ide> AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> readMethod.setAccessible(true); <ide> return null; <ide> public Object run() { <ide> try { <ide> if (System.getSecurityManager() != null) { <ide> oldValue = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { <add> @Override <ide> public Object run() throws Exception { <ide> return readMethod.invoke(object); <ide> } <ide> public Object run() throws Exception { <ide> if (!Modifier.isPublic(writeMethod.getDeclaringClass().getModifiers()) && !writeMethod.isAccessible()) { <ide> if (System.getSecurityManager()!= null) { <ide> AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> writeMethod.setAccessible(true); <ide> return null; <ide> public Object run() { <ide> if (System.getSecurityManager() != null) { <ide> try { <ide> AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { <add> @Override <ide> public Object run() throws Exception { <ide> writeMethod.invoke(object, value); <ide> return null; <ide><path>spring-beans/src/main/java/org/springframework/beans/DirectFieldAccessor.java <ide> public DirectFieldAccessor(final Object target) { <ide> Assert.notNull(target, "Target object must not be null"); <ide> this.target = target; <ide> ReflectionUtils.doWithFields(this.target.getClass(), new ReflectionUtils.FieldCallback() { <add> @Override <ide> public void doWith(Field field) { <ide> if (fieldMap.containsKey(field.getName())) { <ide> // ignore superclass declarations of fields already found in a subclass <ide> public void doWith(Field field) { <ide> } <ide> <ide> <add> @Override <ide> public boolean isReadableProperty(String propertyName) throws BeansException { <ide> return this.fieldMap.containsKey(propertyName); <ide> } <ide> <add> @Override <ide> public boolean isWritableProperty(String propertyName) throws BeansException { <ide> return this.fieldMap.containsKey(propertyName); <ide> } <ide> public Class<?> getPropertyType(String propertyName) throws BeansException { <ide> return null; <ide> } <ide> <add> @Override <ide> public TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws BeansException { <ide> Field field = this.fieldMap.get(propertyName); <ide> if (field != null) { <ide><path>spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java <ide> private List<Method> findCandidateWriteMethods(MethodDescriptor[] methodDescript <ide> // non-deterministic sorting of methods returned from Class#getDeclaredMethods <ide> // under JDK 7. See http://bugs.sun.com/view_bug.do?bug_id=7023180 <ide> Collections.sort(matches, new Comparator<Method>() { <add> @Override <ide> public int compare(Method m1, Method m2) { <ide> return m2.toString().compareTo(m1.toString()); <ide> } <ide> private String propertyNameFor(Method method) { <ide> * method found during construction. <ide> * @see #ExtendedBeanInfo(BeanInfo) <ide> */ <add> @Override <ide> public PropertyDescriptor[] getPropertyDescriptors() { <ide> return this.propertyDescriptors.toArray( <ide> new PropertyDescriptor[this.propertyDescriptors.size()]); <ide> } <ide> <add> @Override <ide> public BeanInfo[] getAdditionalBeanInfo() { <ide> return delegate.getAdditionalBeanInfo(); <ide> } <ide> <add> @Override <ide> public BeanDescriptor getBeanDescriptor() { <ide> return delegate.getBeanDescriptor(); <ide> } <ide> <add> @Override <ide> public int getDefaultEventIndex() { <ide> return delegate.getDefaultEventIndex(); <ide> } <ide> <add> @Override <ide> public int getDefaultPropertyIndex() { <ide> return delegate.getDefaultPropertyIndex(); <ide> } <ide> <add> @Override <ide> public EventSetDescriptor[] getEventSetDescriptors() { <ide> return delegate.getEventSetDescriptors(); <ide> } <ide> <add> @Override <ide> public Image getIcon(int iconKind) { <ide> return delegate.getIcon(iconKind); <ide> } <ide> <add> @Override <ide> public MethodDescriptor[] getMethodDescriptors() { <ide> return delegate.getMethodDescriptors(); <ide> } <ide> public static boolean compareMethods(Method a, Method b) { <ide> */ <ide> class PropertyDescriptorComparator implements Comparator<PropertyDescriptor> { <ide> <add> @Override <ide> public int compare(PropertyDescriptor desc1, PropertyDescriptor desc2) { <ide> String left = desc1.getName(); <ide> String right = desc2.getName(); <ide><path>spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java <ide> public class ExtendedBeanInfoFactory implements Ordered, BeanInfoFactory { <ide> /** <ide> * Return a new {@link ExtendedBeanInfo} for the given bean class. <ide> */ <add> @Override <ide> public BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException { <ide> return supports(beanClass) ? <ide> new ExtendedBeanInfo(Introspector.getBeanInfo(beanClass)) : null; <ide> private boolean supports(Class<?> beanClass) { <ide> return false; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return Ordered.LOWEST_PRECEDENCE; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/MethodInvocationException.java <ide> public MethodInvocationException(PropertyChangeEvent propertyChangeEvent, Throwa <ide> super(propertyChangeEvent, "Property '" + propertyChangeEvent.getPropertyName() + "' threw exception", cause); <ide> } <ide> <add> @Override <ide> public String getErrorCode() { <ide> return ERROR_CODE; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java <ide> public void removePropertyValue(String propertyName) { <ide> } <ide> <ide> <add> @Override <ide> public PropertyValue[] getPropertyValues() { <ide> return this.propertyValueList.toArray(new PropertyValue[this.propertyValueList.size()]); <ide> } <ide> <add> @Override <ide> public PropertyValue getPropertyValue(String propertyName) { <ide> for (PropertyValue pv : this.propertyValueList) { <ide> if (pv.getName().equals(propertyName)) { <ide> public PropertyValue getPropertyValue(String propertyName) { <ide> return null; <ide> } <ide> <add> @Override <ide> public PropertyValues changesSince(PropertyValues old) { <ide> MutablePropertyValues changes = new MutablePropertyValues(); <ide> if (old == this) { <ide> else if (!pvOld.equals(newPv)) { <ide> return changes; <ide> } <ide> <add> @Override <ide> public boolean contains(String propertyName) { <ide> return (getPropertyValue(propertyName) != null || <ide> (this.processedProperties != null && this.processedProperties.contains(propertyName))); <ide> } <ide> <add> @Override <ide> public boolean isEmpty() { <ide> return this.propertyValueList.isEmpty(); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java <ide> protected void copyDefaultEditorsTo(PropertyEditorRegistrySupport target) { <ide> // Management of custom editors <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public void registerCustomEditor(Class<?> requiredType, PropertyEditor propertyEditor) { <ide> registerCustomEditor(requiredType, null, propertyEditor); <ide> } <ide> <add> @Override <ide> public void registerCustomEditor(Class<?> requiredType, String propertyPath, PropertyEditor propertyEditor) { <ide> if (requiredType == null && propertyPath == null) { <ide> throw new IllegalArgumentException("Either requiredType or propertyPath is required"); <ide> public void registerCustomEditor(Class<?> requiredType, String propertyPath, Pro <ide> } <ide> } <ide> <add> @Override <ide> public PropertyEditor findCustomEditor(Class<?> requiredType, String propertyPath) { <ide> Class<?> requiredTypeToUse = requiredType; <ide> if (propertyPath != null) { <ide><path>spring-beans/src/main/java/org/springframework/beans/TypeConverterSupport.java <ide> public abstract class TypeConverterSupport extends PropertyEditorRegistrySupport <ide> TypeConverterDelegate typeConverterDelegate; <ide> <ide> <add> @Override <ide> public <T> T convertIfNecessary(Object value, Class<T> requiredType) throws TypeMismatchException { <ide> return doConvert(value, requiredType, null, null); <ide> } <ide> <add> @Override <ide> public <T> T convertIfNecessary(Object value, Class<T> requiredType, MethodParameter methodParam) <ide> throws TypeMismatchException { <ide> <ide> return doConvert(value, requiredType, methodParam, null); <ide> } <ide> <add> @Override <ide> public <T> T convertIfNecessary(Object value, Class<T> requiredType, Field field) <ide> throws TypeMismatchException { <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java <ide> public Class getRequiredType() { <ide> return this.requiredType; <ide> } <ide> <add> @Override <ide> public String getErrorCode() { <ide> return ERROR_CODE; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.java <ide> protected SingletonBeanFactoryLocator(String resourceLocation) { <ide> this.resourceLocation = resourceLocation; <ide> } <ide> <add> @Override <ide> public BeanFactoryReference useBeanFactory(String factoryKey) throws BeansException { <ide> synchronized (this.bfgInstancesByKey) { <ide> BeanFactoryGroup bfg = this.bfgInstancesByKey.get(this.resourceLocation); <ide> public CountingBeanFactoryReference(BeanFactory beanFactory, BeanFactory groupCo <ide> this.groupContextRef = groupContext; <ide> } <ide> <add> @Override <ide> public BeanFactory getFactory() { <ide> return this.beanFactory; <ide> } <ide> <ide> // Note that it's legal to call release more than once! <add> @Override <ide> public void release() throws FatalBeanException { <ide> synchronized (bfgInstancesByKey) { <ide> BeanFactory savedRef = this.groupContextRef; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/annotation/AnnotatedGenericBeanDefinition.java <ide> public AnnotatedGenericBeanDefinition(AnnotationMetadata metadata) { <ide> } <ide> <ide> <add> @Override <ide> public final AnnotationMetadata getMetadata() { <ide> return this.metadata; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/annotation/AnnotationBeanWiringInfoResolver.java <ide> */ <ide> public class AnnotationBeanWiringInfoResolver implements BeanWiringInfoResolver { <ide> <add> @Override <ide> public BeanWiringInfo resolveWiringInfo(Object beanInstance) { <ide> Assert.notNull(beanInstance, "Bean instance must not be null"); <ide> Configurable annotation = beanInstance.getClass().getAnnotation(Configurable.class); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) throws BeansException { <ide> if (!(beanFactory instanceof ConfigurableListableBeanFactory)) { <ide> throw new IllegalArgumentException( <ide> public void setBeanFactory(BeanFactory beanFactory) throws BeansException { <ide> } <ide> <ide> <add> @Override <ide> public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) { <ide> if (beanType != null) { <ide> InjectionMetadata metadata = findAutowiringMetadata(beanType); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurer.java <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader beanClassLoader) { <ide> this.beanClassLoader = beanClassLoader; <ide> } <ide> public void setCustomQualifierTypes(Set customQualifierTypes) { <ide> } <ide> <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { <ide> if (this.customQualifierTypes != null) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> <ide> <add> @Override <ide> public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) { <ide> if (beanType != null) { <ide> LifecycleMetadata metadata = findLifecycleMetadata(beanType); <ide> metadata.checkConfigMembers(beanDefinition); <ide> } <ide> } <ide> <add> @Override <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { <ide> LifecycleMetadata metadata = findLifecycleMetadata(bean.getClass()); <ide> try { <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) thro <ide> return bean; <ide> } <ide> <add> @Override <ide> public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { <ide> return bean; <ide> } <ide> <add> @Override <ide> public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { <ide> LifecycleMetadata metadata = findLifecycleMetadata(bean.getClass()); <ide> try { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/annotation/QualifierAnnotationAutowireCandidateResolver.java <ide> public void setValueAnnotationType(Class<? extends Annotation> valueAnnotationTy <ide> this.valueAnnotationType = valueAnnotationType; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> } <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> * attribute does not match. <ide> * @see Qualifier <ide> */ <add> @Override <ide> public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) { <ide> if (!bdHolder.getBeanDefinition().isAutowireCandidate()) { <ide> // if explicitly false, do not proceed with qualifier check <ide> protected boolean checkQualifier( <ide> * Determine whether the given dependency carries a value annotation. <ide> * @see Value <ide> */ <add> @Override <ide> public Object getSuggestedValue(DependencyDescriptor descriptor) { <ide> Object value = findValue(descriptor.getAnnotations()); <ide> if (value == null) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java <ide> protected Class<? extends Annotation> getRequiredAnnotationType() { <ide> return this.requiredAnnotationType; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> if (beanFactory instanceof ConfigurableListableBeanFactory) { <ide> this.beanFactory = (ConfigurableListableBeanFactory) beanFactory; <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> <ide> <add> @Override <ide> public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) { <ide> } <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java <ide> public void setSingleton(boolean singleton) { <ide> this.singleton = singleton; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return this.singleton; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader classLoader) { <ide> this.beanClassLoader = classLoader; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> } <ide> protected TypeConverter getBeanTypeConverter() { <ide> /** <ide> * Eagerly create the singleton instance, if necessary. <ide> */ <add> @Override <ide> public void afterPropertiesSet() throws Exception { <ide> if (isSingleton()) { <ide> this.initialized = true; <ide> public void afterPropertiesSet() throws Exception { <ide> * @see #createInstance() <ide> * @see #getEarlySingletonInterfaces() <ide> */ <add> @Override <ide> public final T getObject() throws Exception { <ide> if (isSingleton()) { <ide> return (this.initialized ? this.singletonInstance : getEarlySingletonInstance()); <ide> private T getSingletonInstance() throws IllegalStateException { <ide> * Destroy the singleton instance, if any. <ide> * @see #destroyInstance(Object) <ide> */ <add> @Override <ide> public void destroy() throws Exception { <ide> if (isSingleton()) { <ide> destroyInstance(this.singletonInstance); <ide> public void destroy() throws Exception { <ide> * interface, for a consistent offering of abstract template methods. <ide> * @see org.springframework.beans.factory.FactoryBean#getObjectType() <ide> */ <add> @Override <ide> public abstract Class<?> getObjectType(); <ide> <ide> /** <ide> protected void destroyInstance(T instance) throws Exception { <ide> */ <ide> private class EarlySingletonInvocationHandler implements InvocationHandler { <ide> <add> @Override <ide> public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { <ide> if (ReflectionUtils.isEqualsMethod(method)) { <ide> // Only consider equal when proxies are identical. <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionHolder.java <ide> public String[] getAliases() { <ide> * Expose the bean definition's source object. <ide> * @see BeanDefinition#getSource() <ide> */ <add> @Override <ide> public Object getSource() { <ide> return this.beanDefinition.getSource(); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReferenceFactoryBean.java <ide> public void setTargetBeanName(String targetBeanName) { <ide> this.targetBeanName = targetBeanName; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> if (this.targetBeanName == null) { <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> } <ide> <ide> <add> @Override <ide> public Object getObject() throws BeansException { <ide> if (this.beanFactory == null) { <ide> throw new FactoryBeanNotInitializedException(); <ide> } <ide> return this.beanFactory.getBean(this.targetBeanName); <ide> } <ide> <add> @Override <ide> public Class getObjectType() { <ide> if (this.beanFactory == null) { <ide> return null; <ide> } <ide> return this.beanFactory.getType(this.targetBeanName); <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> if (this.beanFactory == null) { <ide> throw new FactoryBeanNotInitializedException(); <ide> } <ide> return this.beanFactory.isSingleton(this.targetBeanName); <ide> } <ide> <add> @Override <ide> public boolean isPrototype() { <ide> if (this.beanFactory == null) { <ide> throw new FactoryBeanNotInitializedException(); <ide> } <ide> return this.beanFactory.isPrototype(this.targetBeanName); <ide> } <ide> <add> @Override <ide> public boolean isEagerInit() { <ide> return false; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/CommonsLogFactoryBean.java <ide> public void setLogName(String logName) { <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> if (this.log == null) { <ide> throw new IllegalArgumentException("'logName' is required"); <ide> } <ide> } <ide> <add> @Override <ide> public Log getObject() { <ide> return this.log; <ide> } <ide> <add> @Override <ide> public Class<? extends Log> getObjectType() { <ide> return (this.log != null ? this.log.getClass() : Log.class); <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> public void setCustomEditors(Map<Class<?>, Class<? extends PropertyEditor>> cust <ide> } <ide> <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { <ide> if (this.propertyEditorRegistrars != null) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/CustomScopeConfigurer.java <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader beanClassLoader) { <ide> this.beanClassLoader = beanClassLoader; <ide> } <ide> <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { <ide> if (this.scopes != null) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/DeprecatedBeanWarner.java <ide> public void setLoggerName(String loggerName) { <ide> } <ide> <ide> <add> @Override <ide> public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { <ide> if (isLogEnabled()) { <ide> String[] beanNames = beanFactory.getBeanDefinitionNames(); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java <ide> public void setStaticField(String staticField) { <ide> * nor "targetField" have been specified. <ide> * This allows for concise bean definitions with just an id/name. <ide> */ <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = StringUtils.trimAllWhitespace(BeanFactoryUtils.originalBeanName(beanName)); <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader classLoader) { <ide> this.beanClassLoader = classLoader; <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws ClassNotFoundException, NoSuchFieldException { <ide> if (this.targetClass != null && this.targetObject != null) { <ide> throw new IllegalArgumentException("Specify either targetClass or targetObject, not both"); <ide> else if (this.targetField == null) { <ide> } <ide> <ide> <add> @Override <ide> public Object getObject() throws IllegalAccessException { <ide> if (this.fieldObject == null) { <ide> throw new FactoryBeanNotInitializedException(); <ide> public Object getObject() throws IllegalAccessException { <ide> } <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> return (this.fieldObject != null ? this.fieldObject.getType() : null); <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return false; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.java <ide> */ <ide> public abstract class InstantiationAwareBeanPostProcessorAdapter implements SmartInstantiationAwareBeanPostProcessor { <ide> <add> @Override <ide> public Class<?> predictBeanType(Class<?> beanClass, String beanName) { <ide> return null; <ide> } <ide> <add> @Override <ide> public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, String beanName) throws BeansException { <ide> return null; <ide> } <ide> <add> @Override <ide> public Object getEarlyBeanReference(Object bean, String beanName) throws BeansException { <ide> return bean; <ide> } <ide> <add> @Override <ide> public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException { <ide> return null; <ide> } <ide> <add> @Override <ide> public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException { <ide> return true; <ide> } <ide> <add> @Override <ide> public PropertyValues postProcessPropertyValues( <ide> PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) <ide> throws BeansException { <ide> <ide> return pvs; <ide> } <ide> <add> @Override <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { <ide> return bean; <ide> } <ide> <add> @Override <ide> public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { <ide> return bean; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java <ide> public void setSingleton(boolean singleton) { <ide> this.singleton = singleton; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return this.singleton; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader classLoader) { <ide> this.beanClassLoader = classLoader; <ide> } <ide> protected Class resolveClassName(String className) throws ClassNotFoundException <ide> return ClassUtils.forName(className, this.beanClassLoader); <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> if (beanFactory instanceof ConfigurableBeanFactory) { <ide> this.beanFactory = (ConfigurableBeanFactory) beanFactory; <ide> protected TypeConverter getDefaultTypeConverter() { <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws Exception { <ide> prepare(); <ide> if (this.singleton) { <ide> private Object doInvoke() throws Exception { <ide> * to "true", otherwise returns the value returned from invoking the <ide> * specified method on the fly. <ide> */ <add> @Override <ide> public Object getObject() throws Exception { <ide> if (this.singleton) { <ide> if (!this.initialized) { <ide> public Object getObject() throws Exception { <ide> * Return the type of object that this FactoryBean creates, <ide> * or {@code null} if not known in advance. <ide> */ <add> @Override <ide> public Class<?> getObjectType() { <ide> if (!isPrepared()) { <ide> // Not fully initialized yet -> return null to indicate "not known yet". <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java <ide> public TargetBeanObjectFactory(BeanFactory beanFactory, String targetBeanName) { <ide> this.targetBeanName = targetBeanName; <ide> } <ide> <add> @Override <ide> public Object getObject() throws BeansException { <ide> return this.beanFactory.getBean(this.targetBeanName); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java <ide> public void setIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlacehol <ide> * @see #setLocations <ide> * @see org.springframework.core.io.ResourceEditor <ide> */ <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> public void setBeanName(String beanName) { <ide> * @see #setLocations <ide> * @see org.springframework.core.io.ResourceEditor <ide> */ <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/PreferencesPlaceholderConfigurer.java <ide> public void setUserTreePath(String userTreePath) { <ide> * This implementation eagerly fetches the Preferences instances <ide> * for the required system and user tree nodes. <ide> */ <add> @Override <ide> public void afterPropertiesSet() { <ide> this.systemPrefs = (this.systemTreePath != null) ? <ide> Preferences.systemRoot().node(this.systemTreePath) : Preferences.systemRoot(); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java <ide> public final void setSingleton(boolean singleton) { <ide> this.singleton = singleton; <ide> } <ide> <add> @Override <ide> public final boolean isSingleton() { <ide> return this.singleton; <ide> } <ide> <ide> <add> @Override <ide> public final void afterPropertiesSet() throws IOException { <ide> if (this.singleton) { <ide> this.singletonInstance = createProperties(); <ide> } <ide> } <ide> <add> @Override <ide> public final Properties getObject() throws IOException { <ide> if (this.singleton) { <ide> return this.singletonInstance; <ide> public final Properties getObject() throws IOException { <ide> } <ide> } <ide> <add> @Override <ide> public Class<Properties> getObjectType() { <ide> return Properties.class; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java <ide> public void setResultType(Class resultType) { <ide> * "targetBeanName" nor "propertyPath" have been specified. <ide> * This allows for concise bean definitions with just an id/name. <ide> */ <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = StringUtils.trimAllWhitespace(BeanFactoryUtils.originalBeanName(beanName)); <ide> } <ide> <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> <ide> else if (this.propertyPath == null) { <ide> } <ide> <ide> <add> @Override <ide> public Object getObject() throws BeansException { <ide> BeanWrapper target = this.targetBeanWrapper; <ide> if (target != null) { <ide> public Object getObject() throws BeansException { <ide> return target.getPropertyValue(this.propertyPath); <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> return this.resultType; <ide> } <ide> public Class<?> getObjectType() { <ide> * for each call, so we have to assume that we're not returning the <ide> * same object for each {@link #getObject()} call. <ide> */ <add> @Override <ide> public boolean isSingleton() { <ide> return false; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java <ide> public PlaceholderResolvingStringValueResolver(Properties props) { <ide> this.resolver = new PropertyPlaceholderConfigurerResolver(props); <ide> } <ide> <add> @Override <ide> public String resolveStringValue(String strVal) throws BeansException { <ide> String value = this.helper.replacePlaceholders(strVal, this.resolver); <ide> return (value.equals(nullValue) ? null : value); <ide> private PropertyPlaceholderConfigurerResolver(Properties props) { <ide> this.props = props; <ide> } <ide> <add> @Override <ide> public String resolvePlaceholder(String placeholderName) { <ide> return PropertyPlaceholderConfigurer.this.resolvePlaceholder(placeholderName, props, systemPropertiesMode); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyResourceConfigurer.java <ide> public void setOrder(int order) { <ide> this.order = order; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return this.order; <ide> } <ide> public int getOrder() { <ide> * {@linkplain #processProperties process} properties against the given bean factory. <ide> * @throws BeanInitializationException if any properties cannot be loaded <ide> */ <add> @Override <ide> public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { <ide> try { <ide> Properties mergedProps = mergeProperties(); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/ProviderCreatingFactoryBean.java <ide> public TargetBeanProvider(BeanFactory beanFactory, String targetBeanName) { <ide> this.targetBeanName = targetBeanName; <ide> } <ide> <add> @Override <ide> public Object get() throws BeansException { <ide> return this.beanFactory.getBean(this.targetBeanName); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.java <ide> public RuntimeBeanNameReference(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> <add> @Override <ide> public String getBeanName() { <ide> return this.beanName; <ide> } <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java <ide> public RuntimeBeanReference(String beanName, boolean toParent) { <ide> } <ide> <ide> <add> @Override <ide> public String getBeanName() { <ide> return this.beanName; <ide> } <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java <ide> public void setServiceMappings(Properties serviceMappings) { <ide> this.serviceMappings = serviceMappings; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) throws BeansException { <ide> if (!(beanFactory instanceof ListableBeanFactory)) { <ide> throw new FatalBeanException( <ide> public void setBeanFactory(BeanFactory beanFactory) throws BeansException { <ide> this.beanFactory = (ListableBeanFactory) beanFactory; <ide> } <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> if (this.serviceLocatorInterface == null) { <ide> throw new IllegalArgumentException("Property 'serviceLocatorInterface' is required"); <ide> else if (paramTypes[i].isInstance(cause)) { <ide> } <ide> <ide> <add> @Override <ide> public Object getObject() { <ide> return this.proxy; <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> return this.serviceLocatorInterface; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide> public boolean isSingleton() { <ide> */ <ide> private class ServiceLocatorInvocationHandler implements InvocationHandler { <ide> <add> @Override <ide> public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { <ide> if (ReflectionUtils.isEqualsMethod(method)) { <ide> // Only consider equal when proxies are identical. <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/parsing/AbstractComponentDefinition.java <ide> public abstract class AbstractComponentDefinition implements ComponentDefinition <ide> /** <ide> * Delegates to {@link #getName}. <ide> */ <add> @Override <ide> public String getDescription() { <ide> return getName(); <ide> } <ide> <ide> /** <ide> * Returns an empty array. <ide> */ <add> @Override <ide> public BeanDefinition[] getBeanDefinitions() { <ide> return new BeanDefinition[0]; <ide> } <ide> <ide> /** <ide> * Returns an empty array. <ide> */ <add> @Override <ide> public BeanDefinition[] getInnerBeanDefinitions() { <ide> return new BeanDefinition[0]; <ide> } <ide> <ide> /** <ide> * Returns an empty array. <ide> */ <add> @Override <ide> public BeanReference[] getBeanReferences() { <ide> return new BeanReference[0]; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java <ide> public final String getAlias() { <ide> return this.alias; <ide> } <ide> <add> @Override <ide> public final Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java <ide> else if (value instanceof BeanReference) { <ide> } <ide> <ide> <add> @Override <ide> public String getName() { <ide> return getBeanName(); <ide> } <ide> <add> @Override <ide> public String getDescription() { <ide> return getShortDescription(); <ide> } <ide> <add> @Override <ide> public BeanDefinition[] getBeanDefinitions() { <ide> return new BeanDefinition[] {getBeanDefinition()}; <ide> } <ide> <add> @Override <ide> public BeanDefinition[] getInnerBeanDefinitions() { <ide> return this.innerBeanDefinitions; <ide> } <ide> <add> @Override <ide> public BeanReference[] getBeanReferences() { <ide> return this.beanReferences; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/parsing/CompositeComponentDefinition.java <ide> public CompositeComponentDefinition(String name, Object source) { <ide> } <ide> <ide> <add> @Override <ide> public String getName() { <ide> return this.name; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/parsing/EmptyReaderEventListener.java <ide> */ <ide> public class EmptyReaderEventListener implements ReaderEventListener { <ide> <add> @Override <ide> public void defaultsRegistered(DefaultsDefinition defaultsDefinition) { <ide> // no-op <ide> } <ide> <add> @Override <ide> public void componentRegistered(ComponentDefinition componentDefinition) { <ide> // no-op <ide> } <ide> <add> @Override <ide> public void aliasRegistered(AliasDefinition aliasDefinition) { <ide> // no-op <ide> } <ide> <add> @Override <ide> public void importProcessed(ImportDefinition importDefinition) { <ide> // no-op <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.java <ide> public void setLogger(Log logger) { <ide> * that has occurred. <ide> * @param problem the source of the error <ide> */ <add> @Override <ide> public void fatal(Problem problem) { <ide> throw new BeanDefinitionParsingException(problem); <ide> } <ide> public void fatal(Problem problem) { <ide> * that has occurred. <ide> * @param problem the source of the error <ide> */ <add> @Override <ide> public void error(Problem problem) { <ide> throw new BeanDefinitionParsingException(problem); <ide> } <ide> public void error(Problem problem) { <ide> * Writes the supplied {@link Problem} to the {@link Log} at {@code WARN} level. <ide> * @param problem the source of the warning <ide> */ <add> @Override <ide> public void warning(Problem problem) { <ide> this.logger.warn(problem, problem.getRootCause()); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java <ide> public final Resource[] getActualResources() { <ide> return this.actualResources; <ide> } <ide> <add> @Override <ide> public final Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.java <ide> public class NullSourceExtractor implements SourceExtractor { <ide> /** <ide> * This implementation simply returns {@code null} for any input. <ide> */ <add> @Override <ide> public Object extractSource(Object sourceCandidate, Resource definitionResource) { <ide> return null; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.java <ide> public class PassThroughSourceExtractor implements SourceExtractor { <ide> * @param sourceCandidate the source metadata <ide> * @return the supplied {@code sourceCandidate} <ide> */ <add> @Override <ide> public Object extractSource(Object sourceCandidate, Resource definingResource) { <ide> return sourceCandidate; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java <ide> public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) { <ide> // Typical methods for creating and populating external bean instances <ide> //------------------------------------------------------------------------- <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public <T> T createBean(Class<T> beanClass) throws BeansException { <ide> // Use prototype bean definition, to avoid registering bean as dependent bean. <ide> public <T> T createBean(Class<T> beanClass) throws BeansException { <ide> return (T) createBean(beanClass.getName(), bd, null); <ide> } <ide> <add> @Override <ide> public void autowireBean(Object existingBean) { <ide> // Use non-singleton bean definition, to avoid registering bean as dependent bean. <ide> RootBeanDefinition bd = new RootBeanDefinition(ClassUtils.getUserClass(existingBean)); <ide> public void autowireBean(Object existingBean) { <ide> populateBean(bd.getBeanClass().getName(), bd, bw); <ide> } <ide> <add> @Override <ide> public Object configureBean(Object existingBean, String beanName) throws BeansException { <ide> markBeanAsCreated(beanName); <ide> BeanDefinition mbd = getMergedBeanDefinition(beanName); <ide> public Object configureBean(Object existingBean, String beanName) throws BeansEx <ide> return initializeBean(beanName, existingBean, bd); <ide> } <ide> <add> @Override <ide> public Object resolveDependency(DependencyDescriptor descriptor, String beanName) throws BeansException { <ide> return resolveDependency(descriptor, beanName, null, null); <ide> } <ide> public Object resolveDependency(DependencyDescriptor descriptor, String beanName <ide> // Specialized methods for fine-grained control over the bean lifecycle <ide> //------------------------------------------------------------------------- <ide> <add> @Override <ide> public Object createBean(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException { <ide> // Use non-singleton bean definition, to avoid registering bean as dependent bean. <ide> RootBeanDefinition bd = new RootBeanDefinition(beanClass, autowireMode, dependencyCheck); <ide> bd.setScope(BeanDefinition.SCOPE_PROTOTYPE); <ide> return createBean(beanClass.getName(), bd, null); <ide> } <ide> <add> @Override <ide> public Object autowire(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException { <ide> // Use non-singleton bean definition, to avoid registering bean as dependent bean. <ide> final RootBeanDefinition bd = new RootBeanDefinition(beanClass, autowireMode, dependencyCheck); <ide> public Object autowire(Class beanClass, int autowireMode, boolean dependencyChec <ide> if (System.getSecurityManager() != null) { <ide> bean = AccessController.doPrivileged(new PrivilegedAction<Object>() { <ide> <add> @Override <ide> public Object run() { <ide> return getInstantiationStrategy().instantiate(bd, null, parent); <ide> } <ide> public Object run() { <ide> } <ide> } <ide> <add> @Override <ide> public void autowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck) <ide> throws BeansException { <ide> <ide> public void autowireBeanProperties(Object existingBean, int autowireMode, boolea <ide> populateBean(bd.getBeanClass().getName(), bd, bw); <ide> } <ide> <add> @Override <ide> public void applyBeanPropertyValues(Object existingBean, String beanName) throws BeansException { <ide> markBeanAsCreated(beanName); <ide> BeanDefinition bd = getMergedBeanDefinition(beanName); <ide> public void applyBeanPropertyValues(Object existingBean, String beanName) throws <ide> applyPropertyValues(beanName, bd, bw, bd.getPropertyValues()); <ide> } <ide> <add> @Override <ide> public Object initializeBean(Object existingBean, String beanName) { <ide> return initializeBean(beanName, existingBean, null); <ide> } <ide> <add> @Override <ide> public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName) <ide> throws BeansException { <ide> <ide> public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, S <ide> return result; <ide> } <ide> <add> @Override <ide> public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName) <ide> throws BeansException { <ide> <ide> public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, St <ide> return result; <ide> } <ide> <add> @Override <ide> public void destroyBean(Object existingBean) { <ide> new DisposableBeanAdapter(existingBean, getBeanPostProcessors(), getAccessControlContext()).destroy(); <ide> } <ide> protected Object doCreateBean(final String beanName, final RootBeanDefinition mb <ide> "' to allow for resolving potential circular references"); <ide> } <ide> addSingletonFactory(beanName, new ObjectFactory() { <add> @Override <ide> public Object getObject() throws BeansException { <ide> return getEarlyBeanReference(beanName, mbd, bean); <ide> } <ide> class Holder { Class<?> value = null; } <ide> // @Bean methods, there may be parameters present. <ide> ReflectionUtils.doWithMethods(fbClass, <ide> new ReflectionUtils.MethodCallback() { <add> @Override <ide> public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { <ide> if (method.getName().equals(factoryMethodName) && <ide> FactoryBean.class.isAssignableFrom(method.getReturnType())) { <ide> protected BeanWrapper instantiateBean(final String beanName, final RootBeanDefin <ide> final BeanFactory parent = this; <ide> if (System.getSecurityManager() != null) { <ide> beanInstance = AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> return getInstantiationStrategy().instantiate(mbd, beanName, parent); <ide> } <ide> private Object convertForProperty(Object value, String propertyName, BeanWrapper <ide> protected Object initializeBean(final String beanName, final Object bean, RootBeanDefinition mbd) { <ide> if (System.getSecurityManager() != null) { <ide> AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> invokeAwareMethods(beanName, bean); <ide> return null; <ide> protected void invokeInitMethods(String beanName, final Object bean, RootBeanDef <ide> if (System.getSecurityManager() != null) { <ide> try { <ide> AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { <add> @Override <ide> public Object run() throws Exception { <ide> ((InitializingBean) bean).afterPropertiesSet(); <ide> return null; <ide> protected void invokeCustomInitMethod(String beanName, final Object bean, RootBe <ide> <ide> if (System.getSecurityManager() != null) { <ide> AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { <add> @Override <ide> public Object run() throws Exception { <ide> ReflectionUtils.makeAccessible(initMethod); <ide> return null; <ide> } <ide> }); <ide> try { <ide> AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { <add> @Override <ide> public Object run() throws Exception { <ide> initMethod.invoke(bean); <ide> return null; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java <ide> public Class<?> getBeanClass() throws IllegalStateException { <ide> return (Class) beanClassObject; <ide> } <ide> <add> @Override <ide> public void setBeanClassName(String beanClassName) { <ide> this.beanClass = beanClassName; <ide> } <ide> <add> @Override <ide> public String getBeanClassName() { <ide> Object beanClassObject = this.beanClass; <ide> if (beanClassObject instanceof Class) { <ide> public Class resolveBeanClass(ClassLoader classLoader) throws ClassNotFoundExcep <ide> * @see #SCOPE_SINGLETON <ide> * @see #SCOPE_PROTOTYPE <ide> */ <add> @Override <ide> public void setScope(String scope) { <ide> this.scope = scope; <ide> } <ide> <ide> /** <ide> * Return the name of the target scope for the bean. <ide> */ <add> @Override <ide> public String getScope() { <ide> return this.scope; <ide> } <ide> public String getScope() { <ide> * returned from all calls. <ide> * @see #SCOPE_SINGLETON <ide> */ <add> @Override <ide> public boolean isSingleton() { <ide> return SCOPE_SINGLETON.equals(scope) || SCOPE_DEFAULT.equals(scope); <ide> } <ide> public boolean isSingleton() { <ide> * returned for each call. <ide> * @see #SCOPE_PROTOTYPE <ide> */ <add> @Override <ide> public boolean isPrototype() { <ide> return SCOPE_PROTOTYPE.equals(scope); <ide> } <ide> public void setAbstract(boolean abstractFlag) { <ide> * Return whether this bean is "abstract", i.e. not meant to be instantiated <ide> * itself but rather just serving as parent for concrete child bean definitions. <ide> */ <add> @Override <ide> public boolean isAbstract() { <ide> return this.abstractFlag; <ide> } <ide> public boolean isAbstract() { <ide> * <p>If {@code false}, the bean will get instantiated on startup by bean <ide> * factories that perform eager initialization of singletons. <ide> */ <add> @Override <ide> public void setLazyInit(boolean lazyInit) { <ide> this.lazyInit = lazyInit; <ide> } <ide> public void setLazyInit(boolean lazyInit) { <ide> * Return whether this bean should be lazily initialized, i.e. not <ide> * eagerly instantiated on startup. Only applicable to a singleton bean. <ide> */ <add> @Override <ide> public boolean isLazyInit() { <ide> return this.lazyInit; <ide> } <ide> public int getDependencyCheck() { <ide> * constructor arguments. This property should just be necessary for other kinds <ide> * of dependencies like statics (*ugh*) or database preparation on startup. <ide> */ <add> @Override <ide> public void setDependsOn(String[] dependsOn) { <ide> this.dependsOn = dependsOn; <ide> } <ide> <ide> /** <ide> * Return the bean names that this bean depends on. <ide> */ <add> @Override <ide> public String[] getDependsOn() { <ide> return this.dependsOn; <ide> } <ide> <ide> /** <ide> * Set whether this bean is a candidate for getting autowired into some other bean. <ide> */ <add> @Override <ide> public void setAutowireCandidate(boolean autowireCandidate) { <ide> this.autowireCandidate = autowireCandidate; <ide> } <ide> <ide> /** <ide> * Return whether this bean is a candidate for getting autowired into some other bean. <ide> */ <add> @Override <ide> public boolean isAutowireCandidate() { <ide> return this.autowireCandidate; <ide> } <ide> public boolean isAutowireCandidate() { <ide> * If this value is true for exactly one bean among multiple <ide> * matching candidates, it will serve as a tie-breaker. <ide> */ <add> @Override <ide> public void setPrimary(boolean primary) { <ide> this.primary = primary; <ide> } <ide> public void setPrimary(boolean primary) { <ide> * If this value is true for exactly one bean among multiple <ide> * matching candidates, it will serve as a tie-breaker. <ide> */ <add> @Override <ide> public boolean isPrimary() { <ide> return this.primary; <ide> } <ide> public void setConstructorArgumentValues(ConstructorArgumentValues constructorAr <ide> /** <ide> * Return constructor argument values for this bean (never {@code null}). <ide> */ <add> @Override <ide> public ConstructorArgumentValues getConstructorArgumentValues() { <ide> return this.constructorArgumentValues; <ide> } <ide> public void setPropertyValues(MutablePropertyValues propertyValues) { <ide> /** <ide> * Return property values for this bean (never {@code null}). <ide> */ <add> @Override <ide> public MutablePropertyValues getPropertyValues() { <ide> return this.propertyValues; <ide> } <ide> public MethodOverrides getMethodOverrides() { <ide> } <ide> <ide> <add> @Override <ide> public void setFactoryBeanName(String factoryBeanName) { <ide> this.factoryBeanName = factoryBeanName; <ide> } <ide> <add> @Override <ide> public String getFactoryBeanName() { <ide> return this.factoryBeanName; <ide> } <ide> <add> @Override <ide> public void setFactoryMethodName(String factoryMethodName) { <ide> this.factoryMethodName = factoryMethodName; <ide> } <ide> <add> @Override <ide> public String getFactoryMethodName() { <ide> return this.factoryMethodName; <ide> } <ide> public void setRole(int role) { <ide> /** <ide> * Return the role hint for this {@code BeanDefinition}. <ide> */ <add> @Override <ide> public int getRole() { <ide> return this.role; <ide> } <ide> public void setDescription(String description) { <ide> this.description = description; <ide> } <ide> <add> @Override <ide> public String getDescription() { <ide> return this.description; <ide> } <ide> public void setResourceDescription(String resourceDescription) { <ide> this.resource = new DescriptiveResource(resourceDescription); <ide> } <ide> <add> @Override <ide> public String getResourceDescription() { <ide> return (this.resource != null ? this.resource.getDescription() : null); <ide> } <ide> public void setOriginatingBeanDefinition(BeanDefinition originatingBd) { <ide> this.resource = new BeanDefinitionResource(originatingBd); <ide> } <ide> <add> @Override <ide> public BeanDefinition getOriginatingBeanDefinition() { <ide> return (this.resource instanceof BeanDefinitionResource ? <ide> ((BeanDefinitionResource) this.resource).getBeanDefinition() : null); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java <ide> public final BeanDefinitionRegistry getBeanFactory() { <ide> return this.registry; <ide> } <ide> <add> @Override <ide> public final BeanDefinitionRegistry getRegistry() { <ide> return this.registry; <ide> } <ide> public void setResourceLoader(ResourceLoader resourceLoader) { <ide> this.resourceLoader = resourceLoader; <ide> } <ide> <add> @Override <ide> public ResourceLoader getResourceLoader() { <ide> return this.resourceLoader; <ide> } <ide> public void setBeanClassLoader(ClassLoader beanClassLoader) { <ide> this.beanClassLoader = beanClassLoader; <ide> } <ide> <add> @Override <ide> public ClassLoader getBeanClassLoader() { <ide> return this.beanClassLoader; <ide> } <ide> public void setEnvironment(Environment environment) { <ide> this.environment = environment; <ide> } <ide> <add> @Override <ide> public Environment getEnvironment() { <ide> return this.environment; <ide> } <ide> public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) { <ide> this.beanNameGenerator = (beanNameGenerator != null ? beanNameGenerator : new DefaultBeanNameGenerator()); <ide> } <ide> <add> @Override <ide> public BeanNameGenerator getBeanNameGenerator() { <ide> return this.beanNameGenerator; <ide> } <ide> <ide> <add> @Override <ide> public int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStoreException { <ide> Assert.notNull(resources, "Resource array must not be null"); <ide> int counter = 0; <ide> public int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStore <ide> return counter; <ide> } <ide> <add> @Override <ide> public int loadBeanDefinitions(String location) throws BeanDefinitionStoreException { <ide> return loadBeanDefinitions(location, null); <ide> } <ide> public int loadBeanDefinitions(String location, Set<Resource> actualResources) t <ide> } <ide> } <ide> <add> @Override <ide> public int loadBeanDefinitions(String... locations) throws BeanDefinitionStoreException { <ide> Assert.notNull(locations, "Location array must not be null"); <ide> int counter = 0; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java <ide> public AbstractBeanFactory(BeanFactory parentBeanFactory) { <ide> // Implementation of BeanFactory interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public Object getBean(String name) throws BeansException { <ide> return doGetBean(name, null, null, false); <ide> } <ide> <add> @Override <ide> public <T> T getBean(String name, Class<T> requiredType) throws BeansException { <ide> return doGetBean(name, requiredType, null, false); <ide> } <ide> <add> @Override <ide> public Object getBean(String name, Object... args) throws BeansException { <ide> return doGetBean(name, null, args, false); <ide> } <ide> protected <T> T doGetBean( <ide> // Create bean instance. <ide> if (mbd.isSingleton()) { <ide> sharedInstance = getSingleton(beanName, new ObjectFactory<Object>() { <add> @Override <ide> public Object getObject() throws BeansException { <ide> try { <ide> return createBean(beanName, mbd, args); <ide> else if (mbd.isPrototype()) { <ide> } <ide> try { <ide> Object scopedInstance = scope.get(beanName, new ObjectFactory<Object>() { <add> @Override <ide> public Object getObject() throws BeansException { <ide> beforePrototypeCreation(beanName); <ide> try { <ide> public Object getObject() throws BeansException { <ide> return (T) bean; <ide> } <ide> <add> @Override <ide> public boolean containsBean(String name) { <ide> String beanName = transformedBeanName(name); <ide> if (containsSingleton(beanName) || containsBeanDefinition(beanName)) { <ide> public boolean containsBean(String name) { <ide> return (parentBeanFactory != null && parentBeanFactory.containsBean(originalBeanName(name))); <ide> } <ide> <add> @Override <ide> public boolean isSingleton(String name) throws NoSuchBeanDefinitionException { <ide> String beanName = transformedBeanName(name); <ide> <ide> else if (containsSingleton(beanName)) { <ide> } <ide> } <ide> <add> @Override <ide> public boolean isPrototype(String name) throws NoSuchBeanDefinitionException { <ide> String beanName = transformedBeanName(name); <ide> <ide> public boolean isPrototype(String name) throws NoSuchBeanDefinitionException { <ide> final FactoryBean<?> factoryBean = (FactoryBean<?>) getBean(FACTORY_BEAN_PREFIX + beanName); <ide> if (System.getSecurityManager() != null) { <ide> return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { <add> @Override <ide> public Boolean run() { <ide> return ((factoryBean instanceof SmartFactoryBean && ((SmartFactoryBean<?>) factoryBean).isPrototype()) || <ide> !factoryBean.isSingleton()); <ide> public Boolean run() { <ide> } <ide> } <ide> <add> @Override <ide> public boolean isTypeMatch(String name, Class<?> targetType) throws NoSuchBeanDefinitionException { <ide> String beanName = transformedBeanName(name); <ide> Class<?> typeToMatch = (targetType != null ? targetType : Object.class); <ide> else if (containsSingleton(beanName) && !containsBeanDefinition(beanName)) { <ide> } <ide> } <ide> <add> @Override <ide> public Class<?> getType(String name) throws NoSuchBeanDefinitionException { <ide> String beanName = transformedBeanName(name); <ide> <ide> public String[] getAliases(String name) { <ide> // Implementation of HierarchicalBeanFactory interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public BeanFactory getParentBeanFactory() { <ide> return this.parentBeanFactory; <ide> } <ide> <add> @Override <ide> public boolean containsLocalBean(String name) { <ide> String beanName = transformedBeanName(name); <ide> return ((containsSingleton(beanName) || containsBeanDefinition(beanName)) && <ide> public boolean containsLocalBean(String name) { <ide> // Implementation of ConfigurableBeanFactory interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public void setParentBeanFactory(BeanFactory parentBeanFactory) { <ide> if (this.parentBeanFactory != null && this.parentBeanFactory != parentBeanFactory) { <ide> throw new IllegalStateException("Already associated with parent BeanFactory: " + this.parentBeanFactory); <ide> } <ide> this.parentBeanFactory = parentBeanFactory; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader beanClassLoader) { <ide> this.beanClassLoader = (beanClassLoader != null ? beanClassLoader : ClassUtils.getDefaultClassLoader()); <ide> } <ide> <add> @Override <ide> public ClassLoader getBeanClassLoader() { <ide> return this.beanClassLoader; <ide> } <ide> <add> @Override <ide> public void setTempClassLoader(ClassLoader tempClassLoader) { <ide> this.tempClassLoader = tempClassLoader; <ide> } <ide> <add> @Override <ide> public ClassLoader getTempClassLoader() { <ide> return this.tempClassLoader; <ide> } <ide> <add> @Override <ide> public void setCacheBeanMetadata(boolean cacheBeanMetadata) { <ide> this.cacheBeanMetadata = cacheBeanMetadata; <ide> } <ide> <add> @Override <ide> public boolean isCacheBeanMetadata() { <ide> return this.cacheBeanMetadata; <ide> } <ide> <add> @Override <ide> public void setBeanExpressionResolver(BeanExpressionResolver resolver) { <ide> this.beanExpressionResolver = resolver; <ide> } <ide> <add> @Override <ide> public BeanExpressionResolver getBeanExpressionResolver() { <ide> return this.beanExpressionResolver; <ide> } <ide> <add> @Override <ide> public void setConversionService(ConversionService conversionService) { <ide> this.conversionService = conversionService; <ide> } <ide> <add> @Override <ide> public ConversionService getConversionService() { <ide> return this.conversionService; <ide> } <ide> <add> @Override <ide> public void addPropertyEditorRegistrar(PropertyEditorRegistrar registrar) { <ide> Assert.notNull(registrar, "PropertyEditorRegistrar must not be null"); <ide> this.propertyEditorRegistrars.add(registrar); <ide> public Set<PropertyEditorRegistrar> getPropertyEditorRegistrars() { <ide> return this.propertyEditorRegistrars; <ide> } <ide> <add> @Override <ide> public void registerCustomEditor(Class<?> requiredType, Class<? extends PropertyEditor> propertyEditorClass) { <ide> Assert.notNull(requiredType, "Required type must not be null"); <ide> Assert.isAssignable(PropertyEditor.class, propertyEditorClass); <ide> this.customEditors.put(requiredType, propertyEditorClass); <ide> } <ide> <add> @Override <ide> public void copyRegisteredEditorsTo(PropertyEditorRegistry registry) { <ide> registerCustomEditors(registry); <ide> } <ide> public Map<Class<?>, Class<? extends PropertyEditor>> getCustomEditors() { <ide> return this.customEditors; <ide> } <ide> <add> @Override <ide> public void setTypeConverter(TypeConverter typeConverter) { <ide> this.typeConverter = typeConverter; <ide> } <ide> protected TypeConverter getCustomTypeConverter() { <ide> return this.typeConverter; <ide> } <ide> <add> @Override <ide> public TypeConverter getTypeConverter() { <ide> TypeConverter customConverter = getCustomTypeConverter(); <ide> if (customConverter != null) { <ide> public TypeConverter getTypeConverter() { <ide> } <ide> } <ide> <add> @Override <ide> public void addEmbeddedValueResolver(StringValueResolver valueResolver) { <ide> Assert.notNull(valueResolver, "StringValueResolver must not be null"); <ide> this.embeddedValueResolvers.add(valueResolver); <ide> } <ide> <add> @Override <ide> public String resolveEmbeddedValue(String value) { <ide> String result = value; <ide> for (StringValueResolver resolver : this.embeddedValueResolvers) { <ide> public String resolveEmbeddedValue(String value) { <ide> return result; <ide> } <ide> <add> @Override <ide> public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor) { <ide> Assert.notNull(beanPostProcessor, "BeanPostProcessor must not be null"); <ide> this.beanPostProcessors.remove(beanPostProcessor); <ide> public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor) { <ide> } <ide> } <ide> <add> @Override <ide> public int getBeanPostProcessorCount() { <ide> return this.beanPostProcessors.size(); <ide> } <ide> protected boolean hasDestructionAwareBeanPostProcessors() { <ide> return this.hasDestructionAwareBeanPostProcessors; <ide> } <ide> <add> @Override <ide> public void registerScope(String scopeName, Scope scope) { <ide> Assert.notNull(scopeName, "Scope identifier must not be null"); <ide> Assert.notNull(scope, "Scope must not be null"); <ide> public void registerScope(String scopeName, Scope scope) { <ide> this.scopes.put(scopeName, scope); <ide> } <ide> <add> @Override <ide> public String[] getRegisteredScopeNames() { <ide> return StringUtils.toStringArray(this.scopes.keySet()); <ide> } <ide> <add> @Override <ide> public Scope getRegisteredScope(String scopeName) { <ide> Assert.notNull(scopeName, "Scope identifier must not be null"); <ide> return this.scopes.get(scopeName); <ide> public AccessControlContext getAccessControlContext() { <ide> AccessController.getContext()); <ide> } <ide> <add> @Override <ide> public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) { <ide> Assert.notNull(otherFactory, "BeanFactory must not be null"); <ide> setBeanClassLoader(otherFactory.getBeanClassLoader()); <ide> public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) { <ide> * @throws NoSuchBeanDefinitionException if there is no bean with the given name <ide> * @throws BeanDefinitionStoreException in case of an invalid bean definition <ide> */ <add> @Override <ide> public BeanDefinition getMergedBeanDefinition(String name) throws BeansException { <ide> String beanName = transformedBeanName(name); <ide> <ide> public BeanDefinition getMergedBeanDefinition(String name) throws BeansException <ide> return getMergedLocalBeanDefinition(beanName); <ide> } <ide> <add> @Override <ide> public boolean isFactoryBean(String name) throws NoSuchBeanDefinitionException { <ide> String beanName = transformedBeanName(name); <ide> <ide> else if (curVal instanceof Set) { <ide> } <ide> } <ide> <add> @Override <ide> public void destroyBean(String beanName, Object beanInstance) { <ide> destroyBean(beanName, beanInstance, getMergedLocalBeanDefinition(beanName)); <ide> } <ide> protected void destroyBean(String beanName, Object beanInstance, RootBeanDefinit <ide> new DisposableBeanAdapter(beanInstance, beanName, mbd, getBeanPostProcessors(), getAccessControlContext()).destroy(); <ide> } <ide> <add> @Override <ide> public void destroyScopedBean(String beanName) { <ide> RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName); <ide> if (mbd.isSingleton() || mbd.isPrototype()) { <ide> protected Class<?> resolveBeanClass(final RootBeanDefinition mbd, String beanNam <ide> } <ide> if (System.getSecurityManager() != null) { <ide> return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() { <add> @Override <ide> public Class<?> run() throws Exception { <ide> return doResolveBeanClass(mbd, typesToMatch); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java <ide> abstract class AutowireUtils { <ide> */ <ide> public static void sortConstructors(Constructor[] constructors) { <ide> Arrays.sort(constructors, new Comparator<Constructor>() { <add> @Override <ide> public int compare(Constructor c1, Constructor c2) { <ide> boolean p1 = Modifier.isPublic(c1.getModifiers()); <ide> boolean p2 = Modifier.isPublic(c2.getModifiers()); <ide> public int compare(Constructor c1, Constructor c2) { <ide> */ <ide> public static void sortFactoryMethods(Method[] factoryMethods) { <ide> Arrays.sort(factoryMethods, new Comparator<Method>() { <add> @Override <ide> public int compare(Method fm1, Method fm2) { <ide> boolean p1 = Modifier.isPublic(fm1.getModifiers()); <ide> boolean p2 = Modifier.isPublic(fm2.getModifiers()); <ide> public ObjectFactoryDelegatingInvocationHandler(ObjectFactory objectFactory) { <ide> this.objectFactory = objectFactory; <ide> } <ide> <add> @Override <ide> public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { <ide> String methodName = method.getName(); <ide> if (methodName.equals("equals")) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.java <ide> public boolean isReadable() { <ide> return false; <ide> } <ide> <add> @Override <ide> public InputStream getInputStream() throws IOException { <ide> throw new FileNotFoundException( <ide> "Resource cannot be opened because it points to " + getDescription()); <ide> } <ide> <add> @Override <ide> public String getDescription() { <ide> return "BeanDefinition defined in " + this.beanDefinition.getResourceDescription(); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/CglibSubclassingInstantiationStrategy.java <ide> public int hashCode() { <ide> */ <ide> private class LookupOverrideMethodInterceptor extends CglibIdentitySupport implements MethodInterceptor { <ide> <add> @Override <ide> public Object intercept(Object obj, Method method, Object[] args, MethodProxy mp) throws Throwable { <ide> // Cast is safe, as CallbackFilter filters are used selectively. <ide> LookupOverride lo = (LookupOverride) beanDefinition.getMethodOverrides().getOverride(method); <ide> public Object intercept(Object obj, Method method, Object[] args, MethodProxy mp <ide> */ <ide> private class ReplaceOverrideMethodInterceptor extends CglibIdentitySupport implements MethodInterceptor { <ide> <add> @Override <ide> public Object intercept(Object obj, Method method, Object[] args, MethodProxy mp) throws Throwable { <ide> ReplaceOverride ro = (ReplaceOverride) beanDefinition.getMethodOverrides().getOverride(method); <ide> // TODO could cache if a singleton for minor performance optimization <ide> public Object intercept(Object obj, Method method, Object[] args, MethodProxy mp <ide> */ <ide> private class CallbackFilterImpl extends CglibIdentitySupport implements CallbackFilter { <ide> <add> @Override <ide> public int accept(Method method) { <ide> MethodOverride methodOverride = beanDefinition.getMethodOverrides().getOverride(method); <ide> if (logger.isTraceEnabled()) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ChildBeanDefinition.java <ide> public ChildBeanDefinition(ChildBeanDefinition original) { <ide> } <ide> <ide> <add> @Override <ide> public void setParentName(String parentName) { <ide> this.parentName = parentName; <ide> } <ide> <add> @Override <ide> public String getParentName() { <ide> return this.parentName; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java <ide> else if (ambiguousConstructors != null && !mbd.isLenientConstructorResolution()) <ide> final Constructor ctorToUse = constructorToUse; <ide> final Object[] argumentsToUse = argsToUse; <ide> beanInstance = AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> return beanFactory.getInstantiationStrategy().instantiate( <ide> mbd, beanName, beanFactory, ctorToUse, argumentsToUse); <ide> public BeanWrapper instantiateUsingFactoryMethod(final String beanName, final Ro <ide> final Class factoryClazz = factoryClass; <ide> if (System.getSecurityManager() != null) { <ide> rawCandidates = AccessController.doPrivileged(new PrivilegedAction<Method[]>() { <add> @Override <ide> public Method[] run() { <ide> return (mbd.isNonPublicAccessAllowed() ? <ide> ReflectionUtils.getAllDeclaredMethods(factoryClazz) : factoryClazz.getMethods()); <ide> else if (ambiguousFactoryMethods != null && !mbd.isLenientConstructorResolution( <ide> final Method factoryMethod = factoryMethodToUse; <ide> final Object[] args = argsToUse; <ide> beanInstance = AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> return beanFactory.getInstantiationStrategy().instantiate( <ide> mbd, beanName, beanFactory, fb, factoryMethod, args); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultBeanNameGenerator.java <ide> */ <ide> public class DefaultBeanNameGenerator implements BeanNameGenerator { <ide> <add> @Override <ide> public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) { <ide> return BeanDefinitionReaderUtils.generateBeanName(definition, registry); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java <ide> public void setAutowireCandidateResolver(final AutowireCandidateResolver autowir <ide> if (System.getSecurityManager() != null) { <ide> final BeanFactory target = this; <ide> AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> ((BeanFactoryAware) autowireCandidateResolver).setBeanFactory(target); <ide> return null; <ide> public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) { <ide> // Implementation of ListableBeanFactory interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public <T> T getBean(Class<T> requiredType) throws BeansException { <ide> Assert.notNull(requiredType, "Required type must not be null"); <ide> String[] beanNames = getBeanNamesForType(requiredType); <ide> public boolean containsBeanDefinition(String beanName) { <ide> return this.beanDefinitionMap.containsKey(beanName); <ide> } <ide> <add> @Override <ide> public int getBeanDefinitionCount() { <ide> return this.beanDefinitionMap.size(); <ide> } <ide> <add> @Override <ide> public String[] getBeanDefinitionNames() { <ide> synchronized (this.beanDefinitionMap) { <ide> if (this.frozenBeanDefinitionNames != null) { <ide> public String[] getBeanDefinitionNames() { <ide> } <ide> } <ide> <add> @Override <ide> public String[] getBeanNamesForType(Class<?> type) { <ide> return getBeanNamesForType(type, true, true); <ide> } <ide> <add> @Override <ide> public String[] getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit) { <ide> if (!isConfigurationFrozen() || type == null || !allowEagerInit) { <ide> return doGetBeanNamesForType(type, includeNonSingletons, allowEagerInit); <ide> private boolean requiresEagerInitForType(String factoryBeanName) { <ide> return (factoryBeanName != null && isFactoryBean(factoryBeanName) && !containsSingleton(factoryBeanName)); <ide> } <ide> <add> @Override <ide> public <T> Map<String, T> getBeansOfType(Class<T> type) throws BeansException { <ide> return getBeansOfType(type, true, true); <ide> } <ide> <add> @Override <ide> public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit) <ide> throws BeansException { <ide> <ide> public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingle <ide> return result; <ide> } <ide> <add> @Override <ide> public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType) { <ide> Set<String> beanNames = new LinkedHashSet<String>(getBeanDefinitionCount()); <ide> beanNames.addAll(Arrays.asList(getBeanDefinitionNames())); <ide> public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> an <ide> * found on the given class itself, as well as checking its raw bean class <ide> * if not found on the exposed bean reference (e.g. in case of a proxy). <ide> */ <add> @Override <ide> public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) { <ide> A ann = null; <ide> Class<?> beanType = getType(beanName); <ide> public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> a <ide> // Implementation of ConfigurableListableBeanFactory interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public void registerResolvableDependency(Class<?> dependencyType, Object autowiredValue) { <ide> Assert.notNull(dependencyType, "Type must not be null"); <ide> if (autowiredValue != null) { <ide> public void registerResolvableDependency(Class<?> dependencyType, Object autowir <ide> } <ide> } <ide> <add> @Override <ide> public boolean isAutowireCandidate(String beanName, DependencyDescriptor descriptor) <ide> throws NoSuchBeanDefinitionException { <ide> <ide> public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefini <ide> return bd; <ide> } <ide> <add> @Override <ide> public void freezeConfiguration() { <ide> this.configurationFrozen = true; <ide> synchronized (this.beanDefinitionMap) { <ide> this.frozenBeanDefinitionNames = StringUtils.toStringArray(this.beanDefinitionNames); <ide> } <ide> } <ide> <add> @Override <ide> public boolean isConfigurationFrozen() { <ide> return this.configurationFrozen; <ide> } <ide> protected boolean isBeanEligibleForMetadataCaching(String beanName) { <ide> return (this.configurationFrozen || super.isBeanEligibleForMetadataCaching(beanName)); <ide> } <ide> <add> @Override <ide> public void preInstantiateSingletons() throws BeansException { <ide> if (this.logger.isInfoEnabled()) { <ide> this.logger.info("Pre-instantiating singletons in " + this); <ide> public void preInstantiateSingletons() throws BeansException { <ide> boolean isEagerInit; <ide> if (System.getSecurityManager() != null && factory instanceof SmartFactoryBean) { <ide> isEagerInit = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { <add> @Override <ide> public Boolean run() { <ide> return ((SmartFactoryBean<?>) factory).isEagerInit(); <ide> } <ide> public Boolean run() { <ide> // Implementation of BeanDefinitionRegistry interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) <ide> throws BeanDefinitionStoreException { <ide> <ide> public void registerBeanDefinition(String beanName, BeanDefinition beanDefinitio <ide> resetBeanDefinition(beanName); <ide> } <ide> <add> @Override <ide> public void removeBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { <ide> Assert.hasText(beanName, "'beanName' must not be empty"); <ide> <ide> private void clearByTypeCache() { <ide> // Dependency resolution functionality <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public Object resolveDependency(DependencyDescriptor descriptor, String beanName, <ide> Set<String> autowiredBeanNames, TypeConverter typeConverter) throws BeansException { <ide> <ide> public DependencyObjectFactory(DependencyDescriptor descriptor, String beanName) <ide> this.beanName = beanName; <ide> } <ide> <add> @Override <ide> public Object getObject() throws BeansException { <ide> return doResolveDependency(this.descriptor, this.descriptor.getDependencyType(), this.beanName, null, null); <ide> } <ide> public DependencyProvider(DependencyDescriptor descriptor, String beanName) { <ide> super(descriptor, beanName); <ide> } <ide> <add> @Override <ide> public Object get() throws BeansException { <ide> return getObject(); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java <ide> public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements <ide> private final Map<String, Set<String>> dependenciesForBeanMap = new ConcurrentHashMap<String, Set<String>>(64); <ide> <ide> <add> @Override <ide> public void registerSingleton(String beanName, Object singletonObject) throws IllegalStateException { <ide> Assert.notNull(beanName, "'beanName' must not be null"); <ide> synchronized (this.singletonObjects) { <ide> protected void addSingletonFactory(String beanName, ObjectFactory singletonFacto <ide> } <ide> } <ide> <add> @Override <ide> public Object getSingleton(String beanName) { <ide> return getSingleton(beanName, true); <ide> } <ide> protected void removeSingleton(String beanName) { <ide> } <ide> } <ide> <add> @Override <ide> public boolean containsSingleton(String beanName) { <ide> return (this.singletonObjects.containsKey(beanName)); <ide> } <ide> <add> @Override <ide> public String[] getSingletonNames() { <ide> synchronized (this.singletonObjects) { <ide> return StringUtils.toStringArray(this.registeredSingletons); <ide> } <ide> } <ide> <add> @Override <ide> public int getSingletonCount() { <ide> synchronized (this.singletonObjects) { <ide> return this.registeredSingletons.size(); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java <ide> private List<DestructionAwareBeanPostProcessor> filterPostProcessors(List<BeanPo <ide> } <ide> <ide> <add> @Override <ide> public void run() { <ide> destroy(); <ide> } <ide> <add> @Override <ide> public void destroy() { <ide> if (this.beanPostProcessors != null && !this.beanPostProcessors.isEmpty()) { <ide> for (DestructionAwareBeanPostProcessor processor : this.beanPostProcessors) { <ide> public void destroy() { <ide> try { <ide> if (System.getSecurityManager() != null) { <ide> AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { <add> @Override <ide> public Object run() throws Exception { <ide> ((DisposableBean) bean).destroy(); <ide> return null; <ide> private Method determineDestroyMethod() { <ide> try { <ide> if (System.getSecurityManager() != null) { <ide> return AccessController.doPrivileged(new PrivilegedAction<Method>() { <add> @Override <ide> public Method run() { <ide> return findDestroyMethod(); <ide> } <ide> private void invokeCustomDestroyMethod(final Method destroyMethod) { <ide> try { <ide> if (System.getSecurityManager() != null) { <ide> AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> ReflectionUtils.makeAccessible(destroyMethod); <ide> return null; <ide> } <ide> }); <ide> try { <ide> AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { <add> @Override <ide> public Object run() throws Exception { <ide> destroyMethod.invoke(bean, args); <ide> return null; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/FactoryBeanRegistrySupport.java <ide> protected Class getTypeForFactoryBean(final FactoryBean factoryBean) { <ide> try { <ide> if (System.getSecurityManager() != null) { <ide> return AccessController.doPrivileged(new PrivilegedAction<Class>() { <add> @Override <ide> public Class run() { <ide> return factoryBean.getObjectType(); <ide> } <ide> private Object doGetObjectFromFactoryBean( <ide> AccessControlContext acc = getAccessControlContext(); <ide> try { <ide> object = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { <add> @Override <ide> public Object run() throws Exception { <ide> return factory.getObject(); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/GenericBeanDefinition.java <ide> public GenericBeanDefinition(BeanDefinition original) { <ide> } <ide> <ide> <add> @Override <ide> public void setParentName(String parentName) { <ide> this.parentName = parentName; <ide> } <ide> <add> @Override <ide> public String getParentName() { <ide> return this.parentName; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide> public void setMergeEnabled(boolean mergeEnabled) { <ide> this.mergeEnabled = mergeEnabled; <ide> } <ide> <add> @Override <ide> public boolean isMergeEnabled() { <ide> return this.mergeEnabled; <ide> } <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public List<E> merge(Object parent) { <ide> if (!this.mergeEnabled) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedMap.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide> public void setMergeEnabled(boolean mergeEnabled) { <ide> this.mergeEnabled = mergeEnabled; <ide> } <ide> <add> @Override <ide> public boolean isMergeEnabled() { <ide> return this.mergeEnabled; <ide> } <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public Object merge(Object parent) { <ide> if (!this.mergeEnabled) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedProperties.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide> public void setMergeEnabled(boolean mergeEnabled) { <ide> this.mergeEnabled = mergeEnabled; <ide> } <ide> <add> @Override <ide> public boolean isMergeEnabled() { <ide> return this.mergeEnabled; <ide> } <ide> <ide> <add> @Override <ide> public Object merge(Object parent) { <ide> if (!this.mergeEnabled) { <ide> throw new IllegalStateException("Not allowed to merge when the 'mergeEnabled' property is set to 'false'"); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide> public void setMergeEnabled(boolean mergeEnabled) { <ide> this.mergeEnabled = mergeEnabled; <ide> } <ide> <add> @Override <ide> public boolean isMergeEnabled() { <ide> return this.mergeEnabled; <ide> } <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public Set<E> merge(Object parent) { <ide> if (!this.mergeEnabled) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverride.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java <ide> public PropertiesPersister getPropertiesPersister() { <ide> * @throws BeanDefinitionStoreException in case of loading or parsing errors <ide> * @see #loadBeanDefinitions(org.springframework.core.io.Resource, String) <ide> */ <add> @Override <ide> public int loadBeanDefinitions(Resource resource) throws BeanDefinitionStoreException { <ide> return loadBeanDefinitions(new EncodedResource(resource), null); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java <ide> public RootBeanDefinition(RootBeanDefinition original) { <ide> } <ide> <ide> <add> @Override <ide> public String getParentName() { <ide> return null; <ide> } <ide> <add> @Override <ide> public void setParentName(String parentName) { <ide> if (parentName != null) { <ide> throw new IllegalArgumentException("Root bean cannot be changed into a child bean with parent reference"); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleAutowireCandidateResolver.java <ide> public class SimpleAutowireCandidateResolver implements AutowireCandidateResolve <ide> * <p>To be considered a candidate the bean's <em>autowire-candidate</em> <ide> * attribute must not have been set to 'false'. <ide> */ <add> @Override <ide> public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) { <ide> return bdHolder.getBeanDefinition().isAutowireCandidate(); <ide> } <ide> <add> @Override <ide> public Object getSuggestedValue(DependencyDescriptor descriptor) { <ide> return null; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java <ide> public class SimpleBeanDefinitionRegistry extends SimpleAliasRegistry implements <ide> private final Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<String, BeanDefinition>(64); <ide> <ide> <add> @Override <ide> public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) <ide> throws BeanDefinitionStoreException { <ide> <ide> public void registerBeanDefinition(String beanName, BeanDefinition beanDefinitio <ide> this.beanDefinitionMap.put(beanName, beanDefinition); <ide> } <ide> <add> @Override <ide> public void removeBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { <ide> if (this.beanDefinitionMap.remove(beanName) == null) { <ide> throw new NoSuchBeanDefinitionException(beanName); <ide> } <ide> } <ide> <add> @Override <ide> public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { <ide> BeanDefinition bd = this.beanDefinitionMap.get(beanName); <ide> if (bd == null) { <ide> public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefini <ide> return bd; <ide> } <ide> <add> @Override <ide> public boolean containsBeanDefinition(String beanName) { <ide> return this.beanDefinitionMap.containsKey(beanName); <ide> } <ide> <add> @Override <ide> public String[] getBeanDefinitionNames() { <ide> return StringUtils.toStringArray(this.beanDefinitionMap.keySet()); <ide> } <ide> <add> @Override <ide> public int getBeanDefinitionCount() { <ide> return this.beanDefinitionMap.size(); <ide> } <ide> <add> @Override <ide> public boolean isBeanNameInUse(String beanName) { <ide> return isAlias(beanName) || containsBeanDefinition(beanName); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleInstantiationStrategy.java <ide> public static Method getCurrentlyInvokedFactoryMethod() { <ide> } <ide> <ide> <add> @Override <ide> public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) { <ide> // Don't override the class with CGLIB if no overrides. <ide> if (beanDefinition.getMethodOverrides().isEmpty()) { <ide> public Object instantiate(RootBeanDefinition beanDefinition, String beanName, Be <ide> try { <ide> if (System.getSecurityManager() != null) { <ide> constructorToUse = AccessController.doPrivileged(new PrivilegedExceptionAction<Constructor>() { <add> @Override <ide> public Constructor run() throws Exception { <ide> return clazz.getDeclaredConstructor((Class[]) null); <ide> } <ide> protected Object instantiateWithMethodInjection( <ide> "Method Injection not supported in SimpleInstantiationStrategy"); <ide> } <ide> <add> @Override <ide> public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, <ide> final Constructor<?> ctor, Object[] args) { <ide> <ide> if (beanDefinition.getMethodOverrides().isEmpty()) { <ide> if (System.getSecurityManager() != null) { <ide> // use own privileged to change accessibility (when security is on) <ide> AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> ReflectionUtils.makeAccessible(ctor); <ide> return null; <ide> protected Object instantiateWithMethodInjection(RootBeanDefinition beanDefinitio <ide> "Method Injection not supported in SimpleInstantiationStrategy"); <ide> } <ide> <add> @Override <ide> public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, <ide> Object factoryBean, final Method factoryMethod, Object[] args) { <ide> <ide> try { <ide> if (System.getSecurityManager() != null) { <ide> AccessController.doPrivileged(new PrivilegedAction<Object>() { <add> @Override <ide> public Object run() { <ide> ReflectionUtils.makeAccessible(factoryMethod); <ide> return null; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java <ide> public SimpleSecurityContextProvider(AccessControlContext acc) { <ide> } <ide> <ide> <add> @Override <ide> public AccessControlContext getAccessControlContext() { <ide> return (this.acc != null ? acc : AccessController.getContext()); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java <ide> public void addBean(String name, Object bean) { <ide> // Implementation of BeanFactory interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public Object getBean(String name) throws BeansException { <ide> String beanName = BeanFactoryUtils.transformedBeanName(name); <ide> Object bean = this.beans.get(beanName); <ide> public Object getBean(String name) throws BeansException { <ide> } <ide> } <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public <T> T getBean(String name, Class<T> requiredType) throws BeansException { <ide> Object bean = getBean(name); <ide> public <T> T getBean(String name, Class<T> requiredType) throws BeansException { <ide> return (T) bean; <ide> } <ide> <add> @Override <ide> public <T> T getBean(Class<T> requiredType) throws BeansException { <ide> String[] beanNames = getBeanNamesForType(requiredType); <ide> if (beanNames.length == 1) { <ide> else if (beanNames.length > 1) { <ide> } <ide> } <ide> <add> @Override <ide> public Object getBean(String name, Object... args) throws BeansException { <ide> if (args != null) { <ide> throw new UnsupportedOperationException( <ide> public Object getBean(String name, Object... args) throws BeansException { <ide> return getBean(name); <ide> } <ide> <add> @Override <ide> public boolean containsBean(String name) { <ide> return this.beans.containsKey(name); <ide> } <ide> <add> @Override <ide> public boolean isSingleton(String name) throws NoSuchBeanDefinitionException { <ide> Object bean = getBean(name); <ide> // In case of FactoryBean, return singleton status of created object. <ide> return (bean instanceof FactoryBean && ((FactoryBean) bean).isSingleton()); <ide> } <ide> <add> @Override <ide> public boolean isPrototype(String name) throws NoSuchBeanDefinitionException { <ide> Object bean = getBean(name); <ide> // In case of FactoryBean, return prototype status of created object. <ide> return ((bean instanceof SmartFactoryBean && ((SmartFactoryBean) bean).isPrototype()) || <ide> (bean instanceof FactoryBean && !((FactoryBean) bean).isSingleton())); <ide> } <ide> <add> @Override <ide> public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException { <ide> Class type = getType(name); <ide> return (targetType == null || (type != null && targetType.isAssignableFrom(type))); <ide> } <ide> <add> @Override <ide> public Class<?> getType(String name) throws NoSuchBeanDefinitionException { <ide> String beanName = BeanFactoryUtils.transformedBeanName(name); <ide> <ide> public Class<?> getType(String name) throws NoSuchBeanDefinitionException { <ide> return bean.getClass(); <ide> } <ide> <add> @Override <ide> public String[] getAliases(String name) { <ide> return new String[0]; <ide> } <ide> public String[] getAliases(String name) { <ide> // Implementation of ListableBeanFactory interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public boolean containsBeanDefinition(String name) { <ide> return this.beans.containsKey(name); <ide> } <ide> <add> @Override <ide> public int getBeanDefinitionCount() { <ide> return this.beans.size(); <ide> } <ide> <add> @Override <ide> public String[] getBeanDefinitionNames() { <ide> return StringUtils.toStringArray(this.beans.keySet()); <ide> } <ide> <add> @Override <ide> public String[] getBeanNamesForType(Class type) { <ide> return getBeanNamesForType(type, true, true); <ide> } <ide> <add> @Override <ide> public String[] getBeanNamesForType(Class type, boolean includeNonSingletons, boolean includeFactoryBeans) { <ide> boolean isFactoryType = (type != null && FactoryBean.class.isAssignableFrom(type)); <ide> List<String> matches = new ArrayList<String>(); <ide> public String[] getBeanNamesForType(Class type, boolean includeNonSingletons, bo <ide> return StringUtils.toStringArray(matches); <ide> } <ide> <add> @Override <ide> public <T> Map<String, T> getBeansOfType(Class<T> type) throws BeansException { <ide> return getBeansOfType(type, true, true); <ide> } <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean includeFactoryBeans) <ide> throws BeansException { <ide> public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingle <ide> return matches; <ide> } <ide> <add> @Override <ide> public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType) <ide> throws BeansException { <ide> <ide> public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> an <ide> return results; <ide> } <ide> <add> @Override <ide> public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) { <ide> return AnnotationUtils.findAnnotation(getType(beanName), annotationType); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.java <ide> public void setBeanWiringInfoResolver(BeanWiringInfoResolver beanWiringInfoResol <ide> /** <ide> * Set the {@link BeanFactory} in which this aspect must configure beans. <ide> */ <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> if (!(beanFactory instanceof ConfigurableListableBeanFactory)) { <ide> throw new IllegalArgumentException( <ide> protected BeanWiringInfoResolver createDefaultBeanWiringInfoResolver() { <ide> /** <ide> * Check that a {@link BeanFactory} has been set. <ide> */ <add> @Override <ide> public void afterPropertiesSet() { <ide> Assert.notNull(this.beanFactory, "BeanFactory must be set"); <ide> } <ide> public void afterPropertiesSet() { <ide> * Release references to the {@link BeanFactory} and <ide> * {@link BeanWiringInfoResolver} when the container is destroyed. <ide> */ <add> @Override <ide> public void destroy() { <ide> this.beanFactory = null; <ide> this.beanWiringInfoResolver = null; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/wiring/ClassNameBeanWiringInfoResolver.java <ide> */ <ide> public class ClassNameBeanWiringInfoResolver implements BeanWiringInfoResolver { <ide> <add> @Override <ide> public BeanWiringInfo resolveWiringInfo(Object beanInstance) { <ide> Assert.notNull(beanInstance, "Bean instance must not be null"); <ide> return new BeanWiringInfo(ClassUtils.getUserClass(beanInstance).getName(), true); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java <ide> public abstract class AbstractBeanDefinitionParser implements BeanDefinitionPars <ide> /** Constant for the name attribute */ <ide> public static final String NAME_ATTRIBUTE = "name"; <ide> <add> @Override <ide> public final BeanDefinition parse(Element element, ParserContext parserContext) { <ide> AbstractBeanDefinition definition = parseInternal(element, parserContext); <ide> if (definition != null && !parserContext.isNested()) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/BeansDtdResolver.java <ide> public class BeansDtdResolver implements EntityResolver { <ide> private static final Log logger = LogFactory.getLog(BeansDtdResolver.class); <ide> <ide> <add> @Override <ide> public InputSource resolveEntity(String publicId, String systemId) throws IOException { <ide> if (logger.isTraceEnabled()) { <ide> logger.trace("Trying to resolve XML entity with public ID [" + publicId + <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultBeanDefinitionDocumentReader.java <ide> public class DefaultBeanDefinitionDocumentReader implements BeanDefinitionDocume <ide> * {@code <beans/>} element with a {@code profile} attribute present. <ide> * @see #doRegisterBeanDefinitions <ide> */ <add> @Override <ide> public void setEnvironment(Environment environment) { <ide> this.environment = environment; <ide> } <ide> public void setEnvironment(Environment environment) { <ide> * <p>Opens a DOM Document; then initializes the default settings <ide> * specified at the {@code <beans/>} level; then parses the contained bean definitions. <ide> */ <add> @Override <ide> public void registerBeanDefinitions(Document doc, XmlReaderContext readerContext) { <ide> this.readerContext = readerContext; <ide> logger.debug("Loading bean definitions"); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultDocumentLoader.java <ide> public class DefaultDocumentLoader implements DocumentLoader { <ide> * Load the {@link Document} at the supplied {@link InputSource} using the standard JAXP-configured <ide> * XML parser. <ide> */ <add> @Override <ide> public Document loadDocument(InputSource inputSource, EntityResolver entityResolver, <ide> ErrorHandler errorHandler, int validationMode, boolean namespaceAware) throws Exception { <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java <ide> public DefaultNamespaceHandlerResolver(ClassLoader classLoader, String handlerMa <ide> * @param namespaceUri the relevant namespace URI <ide> * @return the located {@link NamespaceHandler}, or {@code null} if none found <ide> */ <add> @Override <ide> public NamespaceHandler resolve(String namespaceUri) { <ide> Map<String, Object> handlerMappings = getHandlerMappings(); <ide> Object handlerOrClassName = handlerMappings.get(namespaceUri); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java <ide> public DelegatingEntityResolver(EntityResolver dtdResolver, EntityResolver schem <ide> } <ide> <ide> <add> @Override <ide> public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { <ide> if (systemId != null) { <ide> if (systemId.endsWith(DTD_SUFFIX)) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/DocumentDefaultsDefinition.java <ide> public void setSource(Object source) { <ide> this.source = source; <ide> } <ide> <add> @Override <ide> public Object getSource() { <ide> return this.source; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandlerSupport.java <ide> public abstract class NamespaceHandlerSupport implements NamespaceHandler { <ide> * Parses the supplied {@link Element} by delegating to the {@link BeanDefinitionParser} that is <ide> * registered for that {@link Element}. <ide> */ <add> @Override <ide> public BeanDefinition parse(Element element, ParserContext parserContext) { <ide> return findParserForElement(element, parserContext).parse(element, parserContext); <ide> } <ide> private BeanDefinitionParser findParserForElement(Element element, ParserContext <ide> * Decorates the supplied {@link Node} by delegating to the {@link BeanDefinitionDecorator} that <ide> * is registered to handle that {@link Node}. <ide> */ <add> @Override <ide> public BeanDefinitionHolder decorate( <ide> Node node, BeanDefinitionHolder definition, ParserContext parserContext) { <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java <ide> public PluggableSchemaResolver(ClassLoader classLoader, String schemaMappingsLoc <ide> this.schemaMappingsLocation = schemaMappingsLocation; <ide> } <ide> <add> @Override <ide> public InputSource resolveEntity(String publicId, String systemId) throws IOException { <ide> if (logger.isTraceEnabled()) { <ide> logger.trace("Trying to resolve XML entity with public id [" + publicId + <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/SimpleConstructorNamespaceHandler.java <ide> public class SimpleConstructorNamespaceHandler implements NamespaceHandler { <ide> private static final String REF_SUFFIX = "-ref"; <ide> private static final String DELIMITER_PREFIX = "_"; <ide> <add> @Override <ide> public void init() { <ide> } <ide> <add> @Override <ide> public BeanDefinition parse(Element element, ParserContext parserContext) { <ide> parserContext.getReaderContext().error( <ide> "Class [" + getClass().getName() + "] does not support custom elements.", element); <ide> return null; <ide> } <ide> <add> @Override <ide> public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) { <ide> if (node instanceof Attr) { <ide> Attr attr = (Attr) node; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/SimplePropertyNamespaceHandler.java <ide> public class SimplePropertyNamespaceHandler implements NamespaceHandler { <ide> private static final String REF_SUFFIX = "-ref"; <ide> <ide> <add> @Override <ide> public void init() { <ide> } <ide> <add> @Override <ide> public BeanDefinition parse(Element element, ParserContext parserContext) { <ide> parserContext.getReaderContext().error( <ide> "Class [" + getClass().getName() + "] does not support custom elements.", element); <ide> return null; <ide> } <ide> <add> @Override <ide> public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) { <ide> if (node instanceof Attr) { <ide> Attr attr = (Attr) node; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/UtilNamespaceHandler.java <ide> public class UtilNamespaceHandler extends NamespaceHandlerSupport { <ide> private static final String SCOPE_ATTRIBUTE = "scope"; <ide> <ide> <add> @Override <ide> public void init() { <ide> registerBeanDefinitionParser("constant", new ConstantBeanDefinitionParser()); <ide> registerBeanDefinitionParser("property-path", new PropertyPathBeanDefinitionParser()); <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java <ide> public void setDocumentReaderClass(Class<?> documentReaderClass) { <ide> * @return the number of bean definitions found <ide> * @throws BeanDefinitionStoreException in case of loading or parsing errors <ide> */ <add> @Override <ide> public int loadBeanDefinitions(Resource resource) throws BeanDefinitionStoreException { <ide> return loadBeanDefinitions(new EncodedResource(resource)); <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.java <ide> public void setProperty(String property) { <ide> } <ide> } <ide> <add> @Override <ide> public String getProperty() { <ide> return this.property; <ide> } <ide> public void setIgnoreCase(boolean ignoreCase) { <ide> this.ignoreCase = ignoreCase; <ide> } <ide> <add> @Override <ide> public boolean isIgnoreCase() { <ide> return this.ignoreCase; <ide> } <ide> public void setAscending(boolean ascending) { <ide> this.ascending = ascending; <ide> } <ide> <add> @Override <ide> public boolean isAscending() { <ide> return this.ascending; <ide> } <ide><path>spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java <ide> public final SortDefinition getSortDefinition() { <ide> } <ide> <ide> <add> @Override <ide> public int compare(Object o1, Object o2) { <ide> Object v1 = getPropertyValue(o1); <ide> Object v2 = getPropertyValue(o2); <ide><path>spring-beans/src/main/java/org/springframework/beans/support/ResourceEditorRegistrar.java <ide> public ResourceEditorRegistrar(ResourceLoader resourceLoader, PropertyResolver p <ide> * @see org.springframework.beans.propertyeditors.ClassArrayEditor <ide> * @see org.springframework.core.io.support.ResourceArrayPropertyEditor <ide> */ <add> @Override <ide> public void registerCustomEditors(PropertyEditorRegistry registry) { <ide> ResourceEditor baseEditor = new ResourceEditor(this.resourceLoader, this.propertyResolver); <ide> doRegisterEditor(registry, Resource.class, baseEditor); <ide><path>spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java <ide> public Number getProperty1() { <ide> } <ide> } <ide> class Child extends Parent { <add> @Override <ide> public Integer getProperty1() { <ide> return 2; <ide> } <ide> public Integer getProperty1() { <ide> @Test <ide> public void cornerSpr9453() throws IntrospectionException { <ide> final class Bean implements Spr9453<Class<?>> { <add> @Override <ide> public Class<?> getProp() { <ide> return null; <ide> } <ide> public void subclassWriteMethodWithCovariantReturnType() throws IntrospectionExc <ide> public Number setFoo(String foo) { return null; } <ide> } <ide> class C extends B { <add> @Override <ide> public String getFoo() { return null; } <add> @Override <ide> public Integer setFoo(String foo) { return null; } <ide> } <ide> <ide> interface BookOperations { <ide> } <ide> <ide> interface TextBookOperations extends BookOperations { <add> @Override <ide> TextBook getBook(); <ide> } <ide> <ide> public void setBook(Book book) { } <ide> } <ide> <ide> class LawLibrary extends Library implements TextBookOperations { <add> @Override <ide> public LawBook getBook() { return null; } <ide> } <ide> <ide> public boolean isTargetMethod() { <ide> } <ide> <ide> class B extends A { <add> @Override <ide> public boolean isTargetMethod() { <ide> return false; <ide> } <ide><path>spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java <ide> public String getName() { <ide> return this.name; <ide> } <ide> <add> @Override <ide> public boolean equals(Object obj) { <ide> if (obj == this) { <ide> return true; <ide> public boolean equals(Object obj) { <ide> return this.name.equals(p.name); <ide> } <ide> <add> @Override <ide> public int hashCode() { <ide> return this.name.hashCode(); <ide> } <ide><path>spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java <ide> public String getName() { <ide> return this.name; <ide> } <ide> <add> @Override <ide> public boolean equals(Object obj) { <ide> if (obj == this) { <ide> return true; <ide> public boolean equals(Object obj) { <ide> return this.name.equals(p.name); <ide> } <ide> <add> @Override <ide> public int hashCode() { <ide> return this.name.hashCode(); <ide> } <ide><path>spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java <ide> public void setExtendedInfo(String extendedInfo) { <ide> this.extendedInfo = extendedInfo; <ide> } <ide> <add> @Override <ide> public boolean equals(Object o) { <ide> if (this == o) return true; <ide> if (!(o instanceof MockFilter)) return false; <ide> public boolean equals(Object o) { <ide> return true; <ide> } <ide> <add> @Override <ide> public int hashCode() { <ide> int result; <ide> result = name.hashCode(); <ide><path>spring-beans/src/test/java/org/springframework/tests/sample/beans/CustomEnum.java <ide> public enum CustomEnum { <ide> <ide> VALUE_1, VALUE_2; <ide> <add> @Override <ide> public String toString() { <ide> return "CustomEnum: " + name(); <ide> } <ide><path>spring-beans/src/test/java/org/springframework/tests/sample/beans/NestedTestBean.java <ide> public String getCompany() { <ide> return company; <ide> } <ide> <add> @Override <ide> public boolean equals(Object obj) { <ide> if (!(obj instanceof NestedTestBean)) { <ide> return false; <ide> public boolean equals(Object obj) { <ide> return this.company.equals(ntb.company); <ide> } <ide> <add> @Override <ide> public int hashCode() { <ide> return this.company.hashCode(); <ide> } <ide> <add> @Override <ide> public String toString() { <ide> return "NestedTestBean: " + this.company; <ide> } <ide><path>spring-beans/src/test/java/org/springframework/tests/sample/beans/Pet.java <ide> public String getName() { <ide> return name; <ide> } <ide> <add> @Override <ide> public String toString() { <ide> return getName(); <ide> } <ide> <add> @Override <ide> public boolean equals(Object o) { <ide> if (this == o) return true; <ide> if (o == null || getClass() != o.getClass()) return false; <ide> public boolean equals(Object o) { <ide> return true; <ide> } <ide> <add> @Override <ide> public int hashCode() { <ide> return (name != null ? name.hashCode() : 0); <ide> } <ide><path>spring-beans/src/test/java/org/springframework/tests/sample/beans/TestBean.java <ide> public void setStringArray(String[] stringArray) { <ide> this.stringArray = stringArray; <ide> } <ide> <add> @Override <ide> public Integer[] getSomeIntegerArray() { <ide> return someIntegerArray; <ide> } <ide> <add> @Override <ide> public void setSomeIntegerArray(Integer[] someIntegerArray) { <ide> this.someIntegerArray = someIntegerArray; <ide> } <ide> public boolean wasDestroyed() { <ide> } <ide> <ide> <add> @Override <ide> public boolean equals(Object other) { <ide> if (this == other) { <ide> return true; <ide> public boolean equals(Object other) { <ide> return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age); <ide> } <ide> <add> @Override <ide> public int hashCode() { <ide> return this.age; <ide> } <ide> public int compareTo(Object other) { <ide> } <ide> } <ide> <add> @Override <ide> public String toString() { <ide> return this.name; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCache.java <ide> public EhCacheCache(Ehcache ehcache) { <ide> } <ide> <ide> <add> @Override <ide> public String getName() { <ide> return this.cache.getName(); <ide> } <ide> <add> @Override <ide> public Ehcache getNativeCache() { <ide> return this.cache; <ide> } <ide> <add> @Override <ide> public ValueWrapper get(Object key) { <ide> Element element = this.cache.get(key); <ide> return (element != null ? new SimpleValueWrapper(element.getObjectValue()) : null); <ide> } <ide> <add> @Override <ide> public void put(Object key, Object value) { <ide> this.cache.put(new Element(key, value)); <ide> } <ide> <add> @Override <ide> public void evict(Object key) { <ide> this.cache.remove(key); <ide> } <ide> <add> @Override <ide> public void clear() { <ide> this.cache.removeAll(); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheFactoryBean.java <ide> public void setDisabled(boolean disabled) { <ide> this.disabled = disabled; <ide> } <ide> <add> @Override <ide> public void setBeanName(String name) { <ide> this.beanName = name; <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws CacheException, IOException { <ide> // If no cache name given, use bean name as cache name. <ide> String cacheName = getName(); <ide> protected Ehcache decorateCache(Ehcache cache) { <ide> } <ide> <ide> <add> @Override <ide> public Ehcache getObject() { <ide> return this.cache; <ide> } <ide> public Ehcache getObject() { <ide> * {@link #getObject()} based on logic in {@link #createCache()} and <ide> * {@link #decorateCache(Ehcache)} as orchestrated by {@link #afterPropertiesSet()}. <ide> */ <add> @Override <ide> public Class<? extends Ehcache> getObjectType() { <ide> if (this.cache != null) { <ide> return this.cache.getClass(); <ide> public Class<? extends Ehcache> getObjectType() { <ide> return Cache.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java <ide> public void setCacheManagerName(String cacheManagerName) { <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws IOException, CacheException { <ide> logger.info("Initializing EhCache CacheManager"); <ide> InputStream is = (this.configLocation != null ? this.configLocation.getInputStream() : null); <ide> public void afterPropertiesSet() throws IOException, CacheException { <ide> } <ide> <ide> <add> @Override <ide> public CacheManager getObject() { <ide> return this.cacheManager; <ide> } <ide> <add> @Override <ide> public Class<? extends CacheManager> getObjectType() { <ide> return (this.cacheManager != null ? this.cacheManager.getClass() : CacheManager.class); <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide> <ide> <add> @Override <ide> public void destroy() { <ide> logger.info("Shutting down EhCache CacheManager"); <ide> this.cacheManager.shutdown(); <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCache.java <ide> public JCacheCache(javax.cache.Cache<?,?> jcache, boolean allowNullValues) { <ide> } <ide> <ide> <add> @Override <ide> public String getName() { <ide> return this.cache.getName(); <ide> } <ide> <add> @Override <ide> public javax.cache.Cache<?,?> getNativeCache() { <ide> return this.cache; <ide> } <ide> public boolean isAllowNullValues() { <ide> return this.allowNullValues; <ide> } <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public ValueWrapper get(Object key) { <ide> Object value = this.cache.get(key); <ide> return (value != null ? new SimpleValueWrapper(fromStoreValue(value)) : null); <ide> } <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public void put(Object key, Object value) { <ide> this.cache.put(key, toStoreValue(value)); <ide> } <ide> <add> @Override <ide> @SuppressWarnings("unchecked") <ide> public void evict(Object key) { <ide> this.cache.remove(key); <ide> } <ide> <add> @Override <ide> public void clear() { <ide> this.cache.removeAll(); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheManagerFactoryBean.java <ide> public void setCacheManagerName(String cacheManagerName) { <ide> this.cacheManagerName = cacheManagerName; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader classLoader) { <ide> this.beanClassLoader = classLoader; <ide> } <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> this.cacheManager = (this.beanClassLoader != null ? <ide> Caching.getCacheManager(this.beanClassLoader, this.cacheManagerName) : <ide> Caching.getCacheManager(this.cacheManagerName)); <ide> } <ide> <ide> <add> @Override <ide> public CacheManager getObject() { <ide> return this.cacheManager; <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> return (this.cacheManager != null ? this.cacheManager.getClass() : CacheManager.class); <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide> <ide> <add> @Override <ide> public void destroy() { <ide> this.cacheManager.shutdown(); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/cache/transaction/TransactionAwareCacheDecorator.java <ide> public TransactionAwareCacheDecorator(Cache targetCache) { <ide> } <ide> <ide> <add> @Override <ide> public String getName() { <ide> return this.targetCache.getName(); <ide> } <ide> <add> @Override <ide> public Object getNativeCache() { <ide> return this.targetCache.getNativeCache(); <ide> } <ide> <add> @Override <ide> public ValueWrapper get(Object key) { <ide> return this.targetCache.get(key); <ide> } <ide> <add> @Override <ide> public void put(final Object key, final Object value) { <ide> if (TransactionSynchronizationManager.isSynchronizationActive()) { <ide> TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { <ide> public void afterCommit() { <ide> } <ide> } <ide> <add> @Override <ide> public void evict(final Object key) { <ide> if (TransactionSynchronizationManager.isSynchronizationActive()) { <ide> TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { <ide> public void afterCommit() { <ide> } <ide> } <ide> <add> @Override <ide> public void clear() { <ide> this.targetCache.clear(); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/cache/transaction/TransactionAwareCacheManagerProxy.java <ide> public void setTargetCacheManager(CacheManager targetCacheManager) { <ide> this.targetCacheManager = targetCacheManager; <ide> } <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> if (this.targetCacheManager == null) { <ide> throw new IllegalStateException("'targetCacheManager' is required"); <ide> } <ide> } <ide> <ide> <add> @Override <ide> public Cache getCache(String name) { <ide> return new TransactionAwareCacheDecorator(this.targetCacheManager.getCache(name)); <ide> } <ide> <add> @Override <ide> public Collection<String> getCacheNames() { <ide> return this.targetCacheManager.getCacheNames(); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/mail/SimpleMailMessage.java <ide> public SimpleMailMessage(SimpleMailMessage original) { <ide> } <ide> <ide> <add> @Override <ide> public void setFrom(String from) { <ide> this.from = from; <ide> } <ide> public String getFrom() { <ide> return this.from; <ide> } <ide> <add> @Override <ide> public void setReplyTo(String replyTo) { <ide> this.replyTo = replyTo; <ide> } <ide> public String getReplyTo() { <ide> return replyTo; <ide> } <ide> <add> @Override <ide> public void setTo(String to) { <ide> this.to = new String[] {to}; <ide> } <ide> <add> @Override <ide> public void setTo(String[] to) { <ide> this.to = to; <ide> } <ide> public String[] getTo() { <ide> return this.to; <ide> } <ide> <add> @Override <ide> public void setCc(String cc) { <ide> this.cc = new String[] {cc}; <ide> } <ide> <add> @Override <ide> public void setCc(String[] cc) { <ide> this.cc = cc; <ide> } <ide> public String[] getCc() { <ide> return cc; <ide> } <ide> <add> @Override <ide> public void setBcc(String bcc) { <ide> this.bcc = new String[] {bcc}; <ide> } <ide> <add> @Override <ide> public void setBcc(String[] bcc) { <ide> this.bcc = bcc; <ide> } <ide> public String[] getBcc() { <ide> return bcc; <ide> } <ide> <add> @Override <ide> public void setSentDate(Date sentDate) { <ide> this.sentDate = sentDate; <ide> } <ide> public Date getSentDate() { <ide> return sentDate; <ide> } <ide> <add> @Override <ide> public void setSubject(String subject) { <ide> this.subject = subject; <ide> } <ide> public String getSubject() { <ide> return this.subject; <ide> } <ide> <add> @Override <ide> public void setText(String text) { <ide> this.text = text; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/mail/javamail/ConfigurableMimeFileTypeMap.java <ide> public void setMappings(String[] mappings) { <ide> /** <ide> * Creates the final merged mapping set. <ide> */ <add> @Override <ide> public void afterPropertiesSet() { <ide> getFileTypeMap(); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSenderImpl.java <ide> public FileTypeMap getDefaultFileTypeMap() { <ide> // Implementation of MailSender <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public void send(SimpleMailMessage simpleMessage) throws MailException { <ide> send(new SimpleMailMessage[] { simpleMessage }); <ide> } <ide> <add> @Override <ide> public void send(SimpleMailMessage[] simpleMessages) throws MailException { <ide> List<MimeMessage> mimeMessages = new ArrayList<MimeMessage>(simpleMessages.length); <ide> for (SimpleMailMessage simpleMessage : simpleMessages) { <ide> public void send(SimpleMailMessage[] simpleMessages) throws MailException { <ide> * @see #setDefaultEncoding <ide> * @see #setDefaultFileTypeMap <ide> */ <add> @Override <ide> public MimeMessage createMimeMessage() { <ide> return new SmartMimeMessage(getSession(), getDefaultEncoding(), getDefaultFileTypeMap()); <ide> } <ide> <add> @Override <ide> public MimeMessage createMimeMessage(InputStream contentStream) throws MailException { <ide> try { <ide> return new MimeMessage(getSession(), contentStream); <ide> public MimeMessage createMimeMessage(InputStream contentStream) throws MailExcep <ide> } <ide> } <ide> <add> @Override <ide> public void send(MimeMessage mimeMessage) throws MailException { <ide> send(new MimeMessage[] {mimeMessage}); <ide> } <ide> <add> @Override <ide> public void send(MimeMessage[] mimeMessages) throws MailException { <ide> doSend(mimeMessages, null); <ide> } <ide> <add> @Override <ide> public void send(MimeMessagePreparator mimeMessagePreparator) throws MailException { <ide> send(new MimeMessagePreparator[] { mimeMessagePreparator }); <ide> } <ide> <add> @Override <ide> public void send(MimeMessagePreparator[] mimeMessagePreparators) throws MailException { <ide> try { <ide> List<MimeMessage> mimeMessages = new ArrayList<MimeMessage>(mimeMessagePreparators.length); <ide><path>spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMailMessage.java <ide> public final MimeMessage getMimeMessage() { <ide> } <ide> <ide> <add> @Override <ide> public void setFrom(String from) throws MailParseException { <ide> try { <ide> this.helper.setFrom(from); <ide> public void setFrom(String from) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setReplyTo(String replyTo) throws MailParseException { <ide> try { <ide> this.helper.setReplyTo(replyTo); <ide> public void setReplyTo(String replyTo) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setTo(String to) throws MailParseException { <ide> try { <ide> this.helper.setTo(to); <ide> public void setTo(String to) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setTo(String[] to) throws MailParseException { <ide> try { <ide> this.helper.setTo(to); <ide> public void setTo(String[] to) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setCc(String cc) throws MailParseException { <ide> try { <ide> this.helper.setCc(cc); <ide> public void setCc(String cc) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setCc(String[] cc) throws MailParseException { <ide> try { <ide> this.helper.setCc(cc); <ide> public void setCc(String[] cc) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setBcc(String bcc) throws MailParseException { <ide> try { <ide> this.helper.setBcc(bcc); <ide> public void setBcc(String bcc) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setBcc(String[] bcc) throws MailParseException { <ide> try { <ide> this.helper.setBcc(bcc); <ide> public void setBcc(String[] bcc) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setSentDate(Date sentDate) throws MailParseException { <ide> try { <ide> this.helper.setSentDate(sentDate); <ide> public void setSentDate(Date sentDate) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setSubject(String subject) throws MailParseException { <ide> try { <ide> this.helper.setSubject(subject); <ide> public void setSubject(String subject) throws MailParseException { <ide> } <ide> } <ide> <add> @Override <ide> public void setText(String text) throws MailParseException { <ide> try { <ide> this.helper.setText(text); <ide><path>spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java <ide> protected DataSource createDataSource( <ide> final InputStreamSource inputStreamSource, final String contentType, final String name) { <ide> <ide> return new DataSource() { <add> @Override <ide> public InputStream getInputStream() throws IOException { <ide> return inputStreamSource.getInputStream(); <ide> } <add> @Override <ide> public OutputStream getOutputStream() { <ide> throw new UnsupportedOperationException("Read-only javax.activation.DataSource"); <ide> } <add> @Override <ide> public String getContentType() { <ide> return contentType; <ide> } <add> @Override <ide> public String getName() { <ide> return name; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/commonj/DelegatingTimerListener.java <ide> public DelegatingTimerListener(Runnable runnable) { <ide> /** <ide> * Delegates execution to the underlying Runnable. <ide> */ <add> @Override <ide> public void timerExpired(Timer timer) { <ide> this.runnable.run(); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/commonj/DelegatingWork.java <ide> public final Runnable getDelegate() { <ide> /** <ide> * Delegates execution to the underlying Runnable. <ide> */ <add> @Override <ide> public void run() { <ide> this.delegate.run(); <ide> } <ide> public void run() { <ide> * {@link org.springframework.scheduling.SchedulingAwareRunnable#isLongLived()}, <ide> * if available. <ide> */ <add> @Override <ide> public boolean isDaemon() { <ide> return (this.delegate instanceof SchedulingAwareRunnable && <ide> ((SchedulingAwareRunnable) this.delegate).isLongLived()); <ide> public boolean isDaemon() { <ide> * This implementation is empty, since we expect the Runnable <ide> * to terminate based on some specific shutdown signal. <ide> */ <add> @Override <ide> public void release() { <ide> } <ide> <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerAccessor.java <ide> public void setShared(boolean shared) { <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws NamingException { <ide> if (this.timerManager == null) { <ide> if (this.timerManagerName == null) { <ide> protected final TimerManager getTimerManager() { <ide> * Resumes the underlying TimerManager (if not shared). <ide> * @see commonj.timers.TimerManager#resume() <ide> */ <add> @Override <ide> public void start() { <ide> if (!this.shared) { <ide> this.timerManager.resume(); <ide> public void start() { <ide> * Suspends the underlying TimerManager (if not shared). <ide> * @see commonj.timers.TimerManager#suspend() <ide> */ <add> @Override <ide> public void stop() { <ide> if (!this.shared) { <ide> this.timerManager.suspend(); <ide> public void stop() { <ide> * @see commonj.timers.TimerManager#isSuspending() <ide> * @see commonj.timers.TimerManager#isStopping() <ide> */ <add> @Override <ide> public boolean isRunning() { <ide> return (!this.timerManager.isSuspending() && !this.timerManager.isStopping()); <ide> } <ide> public boolean isRunning() { <ide> * Stops the underlying TimerManager (if not shared). <ide> * @see commonj.timers.TimerManager#stop() <ide> */ <add> @Override <ide> public void destroy() { <ide> // Stop the entire TimerManager, if necessary. <ide> if (!this.shared) { <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerFactoryBean.java <ide> public void setScheduledTimerListeners(ScheduledTimerListener[] scheduledTimerLi <ide> // Implementation of InitializingBean interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public void afterPropertiesSet() throws NamingException { <ide> super.afterPropertiesSet(); <ide> if (this.scheduledTimerListeners != null) { <ide> public void afterPropertiesSet() throws NamingException { <ide> // Implementation of FactoryBean interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public TimerManager getObject() { <ide> return getTimerManager(); <ide> } <ide> <add> @Override <ide> public Class<? extends TimerManager> getObjectType() { <ide> TimerManager timerManager = getTimerManager(); <ide> return (timerManager != null ? timerManager.getClass() : TimerManager.class); <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerTaskScheduler.java <ide> public void setErrorHandler(ErrorHandler errorHandler) { <ide> } <ide> <ide> <add> @Override <ide> public ScheduledFuture schedule(Runnable task, Trigger trigger) { <ide> return new ReschedulingTimerListener(errorHandlingTask(task, true), trigger).schedule(); <ide> } <ide> <add> @Override <ide> public ScheduledFuture schedule(Runnable task, Date startTime) { <ide> TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, false)); <ide> Timer timer = getTimerManager().schedule(futureTask, startTime); <ide> futureTask.setTimer(timer); <ide> return futureTask; <ide> } <ide> <add> @Override <ide> public ScheduledFuture scheduleAtFixedRate(Runnable task, Date startTime, long period) { <ide> TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); <ide> Timer timer = getTimerManager().scheduleAtFixedRate(futureTask, startTime, period); <ide> futureTask.setTimer(timer); <ide> return futureTask; <ide> } <ide> <add> @Override <ide> public ScheduledFuture scheduleAtFixedRate(Runnable task, long period) { <ide> TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); <ide> Timer timer = getTimerManager().scheduleAtFixedRate(futureTask, 0, period); <ide> futureTask.setTimer(timer); <ide> return futureTask; <ide> } <ide> <add> @Override <ide> public ScheduledFuture scheduleWithFixedDelay(Runnable task, Date startTime, long delay) { <ide> TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); <ide> Timer timer = getTimerManager().schedule(futureTask, startTime, delay); <ide> futureTask.setTimer(timer); <ide> return futureTask; <ide> } <ide> <add> @Override <ide> public ScheduledFuture scheduleWithFixedDelay(Runnable task, long delay) { <ide> TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); <ide> Timer timer = getTimerManager().schedule(futureTask, 0, delay); <ide> public void setTimer(Timer timer) { <ide> this.timer = timer; <ide> } <ide> <add> @Override <ide> public void timerExpired(Timer timer) { <ide> runAndReset(); <ide> } <ide> public boolean cancel(boolean mayInterruptIfRunning) { <ide> return result; <ide> } <ide> <add> @Override <ide> public long getDelay(TimeUnit unit) { <ide> return unit.convert(System.currentTimeMillis() - this.timer.getScheduledExecutionTime(), TimeUnit.MILLISECONDS); <ide> } <ide> <add> @Override <ide> public int compareTo(Delayed other) { <ide> if (this == other) { <ide> return 0; <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/commonj/WorkManagerTaskExecutor.java <ide> public void setWorkListener(WorkListener workListener) { <ide> this.workListener = workListener; <ide> } <ide> <add> @Override <ide> public void afterPropertiesSet() throws NamingException { <ide> if (this.workManager == null) { <ide> if (this.workManagerName == null) { <ide> public void afterPropertiesSet() throws NamingException { <ide> // Implementation of the Spring SchedulingTaskExecutor interface <ide> //------------------------------------------------------------------------- <ide> <add> @Override <ide> public void execute(Runnable task) { <ide> Assert.state(this.workManager != null, "No WorkManager specified"); <ide> Work work = new DelegatingWork(task); <ide> public void execute(Runnable task) { <ide> } <ide> } <ide> <add> @Override <ide> public void execute(Runnable task, long startTimeout) { <ide> execute(task); <ide> } <ide> <add> @Override <ide> public Future<?> submit(Runnable task) { <ide> FutureTask<Object> future = new FutureTask<Object>(task, null); <ide> execute(future); <ide> return future; <ide> } <ide> <add> @Override <ide> public <T> Future<T> submit(Callable<T> task) { <ide> FutureTask<T> future = new FutureTask<T>(task); <ide> execute(future); <ide> public <T> Future<T> submit(Callable<T> task) { <ide> /** <ide> * This task executor prefers short-lived work units. <ide> */ <add> @Override <ide> public boolean prefersShortLivedTasks() { <ide> return true; <ide> } <ide> public boolean prefersShortLivedTasks() { <ide> // Implementation of the CommonJ WorkManager interface <ide> //------------------------------------------------------------------------- <ide> <add> @Override <ide> public WorkItem schedule(Work work) <ide> throws WorkException, IllegalArgumentException { <ide> <ide> return this.workManager.schedule(work); <ide> } <ide> <add> @Override <ide> public WorkItem schedule(Work work, WorkListener workListener) <ide> throws WorkException, IllegalArgumentException { <ide> <ide> return this.workManager.schedule(work, workListener); <ide> } <ide> <add> @Override <ide> public boolean waitForAll(Collection workItems, long timeout) <ide> throws InterruptedException, IllegalArgumentException { <ide> <ide> return this.workManager.waitForAll(workItems, timeout); <ide> } <ide> <add> @Override <ide> public Collection waitForAny(Collection workItems, long timeout) <ide> throws InterruptedException, IllegalArgumentException { <ide> <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/AdaptableJobFactory.java <ide> public Job newJob(TriggerFiredBundle bundle, Scheduler scheduler) throws Schedul <ide> /** <ide> * Quartz 1.x version of newJob: contains actual implementation code. <ide> */ <add> @Override <ide> public Job newJob(TriggerFiredBundle bundle) throws SchedulerException { <ide> try { <ide> Object jobObject = createJobInstance(bundle); <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/CronTriggerBean.java <ide> public void setJobDetail(JobDetail jobDetail) { <ide> this.jobDetail = jobDetail; <ide> } <ide> <add> @Override <ide> public JobDetail getJobDetail() { <ide> return this.jobDetail; <ide> } <ide> <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws Exception { <ide> if (this.startDelay > 0) { <ide> setStartTime(new Date(System.currentTimeMillis() + this.startDelay)); <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/CronTriggerFactoryBean.java <ide> public void setMisfireInstructionName(String constantName) { <ide> this.misfireInstruction = constants.asNumber(constantName).intValue(); <ide> } <ide> <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> if (this.name == null) { <ide> this.name = this.beanName; <ide> else if (this.startTime == null) { <ide> } <ide> <ide> <add> @Override <ide> public CronTrigger getObject() { <ide> return this.cronTrigger; <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> return CronTrigger.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/DelegatingJob.java <ide> public final Runnable getDelegate() { <ide> /** <ide> * Delegates execution to the underlying Runnable. <ide> */ <add> @Override <ide> public void execute(JobExecutionContext context) throws JobExecutionException { <ide> this.delegate.run(); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailBean.java <ide> public void setJobListenerNames(String[] names) { <ide> } <ide> } <ide> <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> <add> @Override <ide> public void setApplicationContext(ApplicationContext applicationContext) { <ide> this.applicationContext = applicationContext; <ide> } <ide> public void setApplicationContextJobDataKey(String applicationContextJobDataKey) <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> if (getName() == null) { <ide> setName(this.beanName); <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java <ide> public void setDescription(String description) { <ide> this.description = description; <ide> } <ide> <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> <add> @Override <ide> public void setApplicationContext(ApplicationContext applicationContext) { <ide> this.applicationContext = applicationContext; <ide> } <ide> public void setApplicationContextJobDataKey(String applicationContextJobDataKey) <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> if (this.name == null) { <ide> this.name = this.beanName; <ide> public void afterPropertiesSet() { <ide> } <ide> <ide> <add> @Override <ide> public JobDetail getObject() { <ide> return this.jobDetail; <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> return JobDetail.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalDataSourceJobStore.java <ide> public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) <ide> DBConnectionManager.getInstance().addConnectionProvider( <ide> TX_DATA_SOURCE_PREFIX + getInstanceName(), <ide> new ConnectionProvider() { <add> @Override <ide> public Connection getConnection() throws SQLException { <ide> // Return a transactional Connection, if any. <ide> return DataSourceUtils.doGetConnection(dataSource); <ide> } <add> @Override <ide> public void shutdown() { <ide> // Do nothing - a Spring-managed DataSource has its own lifecycle. <ide> } <ide> public void shutdown() { <ide> DBConnectionManager.getInstance().addConnectionProvider( <ide> NON_TX_DATA_SOURCE_PREFIX + getInstanceName(), <ide> new ConnectionProvider() { <add> @Override <ide> public Connection getConnection() throws SQLException { <ide> // Always return a non-transactional Connection. <ide> return nonTxDataSourceToUse.getConnection(); <ide> } <add> @Override <ide> public void shutdown() { <ide> // Do nothing - a Spring-managed DataSource has its own lifecycle. <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java <ide> public class LocalTaskExecutorThreadPool implements ThreadPool { <ide> private Executor taskExecutor; <ide> <ide> <add> @Override <ide> public void setInstanceId(String schedInstId) { <ide> } <ide> <add> @Override <ide> public void setInstanceName(String schedName) { <ide> } <ide> <ide> <add> @Override <ide> public void initialize() throws SchedulerConfigException { <ide> // Absolutely needs thread-bound TaskExecutor to initialize. <ide> this.taskExecutor = SchedulerFactoryBean.getConfigTimeTaskExecutor(); <ide> public void initialize() throws SchedulerConfigException { <ide> } <ide> } <ide> <add> @Override <ide> public void shutdown(boolean waitForJobsToComplete) { <ide> } <ide> <add> @Override <ide> public int getPoolSize() { <ide> return -1; <ide> } <ide> <ide> <add> @Override <ide> public boolean runInThread(Runnable runnable) { <ide> if (runnable == null) { <ide> return false; <ide> public boolean runInThread(Runnable runnable) { <ide> } <ide> } <ide> <add> @Override <ide> public int blockForAvailableThreads() { <ide> // The present implementation always returns 1, making Quartz (1.6) <ide> // always schedule any tasks that it feels like scheduling. <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/MethodInvokingJobDetailFactoryBean.java <ide> public void setJobListenerNames(String[] names) { <ide> this.jobListenerNames = names; <ide> } <ide> <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader classLoader) { <ide> this.beanClassLoader = classLoader; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> } <ide> protected Class resolveClassName(String className) throws ClassNotFoundException <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws ClassNotFoundException, NoSuchMethodException { <ide> prepare(); <ide> <ide> public Object getTargetObject() { <ide> } <ide> <ide> <add> @Override <ide> public JobDetail getObject() { <ide> return this.jobDetail; <ide> } <ide> <add> @Override <ide> public Class<? extends JobDetail> getObjectType() { <ide> return (this.jobDetail != null ? this.jobDetail.getClass() : JobDetail.class); <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/QuartzJobBean.java <ide> public abstract class QuartzJobBean implements Job { <ide> * values, and delegates to {@code executeInternal} afterwards. <ide> * @see #executeInternal <ide> */ <add> @Override <ide> public final void execute(JobExecutionContext context) throws JobExecutionException { <ide> try { <ide> // Reflectively adapting to differences between Quartz 1.x and Quartz 2.0... <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/ResourceLoaderClassLoadHelper.java <ide> public ResourceLoaderClassLoadHelper(ResourceLoader resourceLoader) { <ide> } <ide> <ide> <add> @Override <ide> public void initialize() { <ide> if (this.resourceLoader == null) { <ide> this.resourceLoader = SchedulerFactoryBean.getConfigTimeResourceLoader(); <ide> public void initialize() { <ide> } <ide> } <ide> <add> @Override <ide> public Class loadClass(String name) throws ClassNotFoundException { <ide> return this.resourceLoader.getClassLoader().loadClass(name); <ide> } <ide> public <T> Class<? extends T> loadClass(String name, Class<T> clazz) throws Clas <ide> return loadClass(name); <ide> } <ide> <add> @Override <ide> public URL getResource(String name) { <ide> Resource resource = this.resourceLoader.getResource(name); <ide> try { <ide> public URL getResource(String name) { <ide> } <ide> } <ide> <add> @Override <ide> public InputStream getResourceAsStream(String name) { <ide> Resource resource = this.resourceLoader.getResource(name); <ide> try { <ide> public InputStream getResourceAsStream(String name) { <ide> } <ide> } <ide> <add> @Override <ide> public ClassLoader getClassLoader() { <ide> return this.resourceLoader.getClassLoader(); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java <ide> public void setTransactionManager(PlatformTransactionManager transactionManager) <ide> this.transactionManager = transactionManager; <ide> } <ide> <add> @Override <ide> public void setResourceLoader(ResourceLoader resourceLoader) { <ide> this.resourceLoader = resourceLoader; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessorBean.java <ide> public Scheduler getScheduler() { <ide> return this.scheduler; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) { <ide> this.beanFactory = beanFactory; <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws SchedulerException { <ide> if (this.scheduler == null) { <ide> if (this.schedulerName != null) { <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java <ide> public void setAutoStartup(boolean autoStartup) { <ide> * the scheduler will start after the context is refreshed and after the <ide> * start delay, if any. <ide> */ <add> @Override <ide> public boolean isAutoStartup() { <ide> return this.autoStartup; <ide> } <ide> public void setPhase(int phase) { <ide> /** <ide> * Return the phase in which this scheduler will be started and stopped. <ide> */ <add> @Override <ide> public int getPhase() { <ide> return this.phase; <ide> } <ide> public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnSh <ide> } <ide> <ide> <add> @Override <ide> public void setBeanName(String name) { <ide> if (this.schedulerName == null) { <ide> this.schedulerName = name; <ide> } <ide> } <ide> <add> @Override <ide> public void setApplicationContext(ApplicationContext applicationContext) { <ide> this.applicationContext = applicationContext; <ide> } <ide> public void setApplicationContext(ApplicationContext applicationContext) { <ide> // Implementation of InitializingBean interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public void afterPropertiesSet() throws Exception { <ide> if (this.dataSource == null && this.nonTransactionalDataSource != null) { <ide> this.dataSource = this.nonTransactionalDataSource; <ide> public Scheduler getScheduler() { <ide> return this.scheduler; <ide> } <ide> <add> @Override <ide> public Scheduler getObject() { <ide> return this.scheduler; <ide> } <ide> <add> @Override <ide> public Class<? extends Scheduler> getObjectType() { <ide> return (this.scheduler != null) ? this.scheduler.getClass() : Scheduler.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide> public boolean isSingleton() { <ide> // Implementation of Lifecycle interface <ide> //--------------------------------------------------------------------- <ide> <add> @Override <ide> public void start() throws SchedulingException { <ide> if (this.scheduler != null) { <ide> try { <ide> public void start() throws SchedulingException { <ide> } <ide> } <ide> <add> @Override <ide> public void stop() throws SchedulingException { <ide> if (this.scheduler != null) { <ide> try { <ide> public void stop() throws SchedulingException { <ide> } <ide> } <ide> <add> @Override <ide> public void stop(Runnable callback) throws SchedulingException { <ide> stop(); <ide> callback.run(); <ide> } <ide> <add> @Override <ide> public boolean isRunning() throws SchedulingException { <ide> if (this.scheduler != null) { <ide> try { <ide> public boolean isRunning() throws SchedulingException { <ide> * Shut down the Quartz scheduler on bean factory shutdown, <ide> * stopping all scheduled jobs. <ide> */ <add> @Override <ide> public void destroy() throws SchedulerException { <ide> logger.info("Shutting down Quartz Scheduler"); <ide> this.scheduler.shutdown(this.waitForJobsToCompleteOnShutdown); <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleThreadPoolTaskExecutor.java <ide> public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnSh <ide> this.waitForJobsToCompleteOnShutdown = waitForJobsToCompleteOnShutdown; <ide> } <ide> <add> @Override <ide> public void afterPropertiesSet() throws SchedulerConfigException { <ide> initialize(); <ide> } <ide> <ide> <add> @Override <ide> public void execute(Runnable task) { <ide> Assert.notNull(task, "Runnable must not be null"); <ide> if (!runInThread(task)) { <ide> throw new SchedulingException("Quartz SimpleThreadPool already shut down"); <ide> } <ide> } <ide> <add> @Override <ide> public void execute(Runnable task, long startTimeout) { <ide> execute(task); <ide> } <ide> <add> @Override <ide> public Future<?> submit(Runnable task) { <ide> FutureTask<Object> future = new FutureTask<Object>(task, null); <ide> execute(future); <ide> return future; <ide> } <ide> <add> @Override <ide> public <T> Future<T> submit(Callable<T> task) { <ide> FutureTask<T> future = new FutureTask<T>(task); <ide> execute(future); <ide> public <T> Future<T> submit(Callable<T> task) { <ide> /** <ide> * This task executor prefers short-lived work units. <ide> */ <add> @Override <ide> public boolean prefersShortLivedTasks() { <ide> return true; <ide> } <ide> <ide> <add> @Override <ide> public void destroy() { <ide> shutdown(this.waitForJobsToCompleteOnShutdown); <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleTriggerBean.java <ide> public void setJobDetail(JobDetail jobDetail) { <ide> this.jobDetail = jobDetail; <ide> } <ide> <add> @Override <ide> public JobDetail getJobDetail() { <ide> return this.jobDetail; <ide> } <ide> <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws ParseException { <ide> if (getName() == null) { <ide> setName(this.beanName); <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleTriggerFactoryBean.java <ide> public void setMisfireInstructionName(String constantName) { <ide> this.misfireInstruction = constants.asNumber(constantName).intValue(); <ide> } <ide> <add> @Override <ide> public void setBeanName(String beanName) { <ide> this.beanName = beanName; <ide> } <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws ParseException { <ide> if (this.name == null) { <ide> this.name = this.beanName; <ide> else if (this.startTime == null) { <ide> } <ide> <ide> <add> @Override <ide> public SimpleTrigger getObject() { <ide> return this.simpleTrigger; <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> return SimpleTrigger.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SpringBeanJobFactory.java <ide> public void setIgnoredUnknownProperties(String[] ignoredUnknownProperties) { <ide> this.ignoredUnknownProperties = ignoredUnknownProperties; <ide> } <ide> <add> @Override <ide> public void setSchedulerContext(SchedulerContext schedulerContext) { <ide> this.schedulerContext = schedulerContext; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactoryBean.java <ide> public class FreeMarkerConfigurationFactoryBean extends FreeMarkerConfigurationF <ide> private Configuration configuration; <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws IOException, TemplateException { <ide> this.configuration = createConfiguration(); <ide> } <ide> <ide> <add> @Override <ide> public Configuration getObject() { <ide> return this.configuration; <ide> } <ide> <add> @Override <ide> public Class<? extends Configuration> getObjectType() { <ide> return Configuration.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-context-support/src/main/java/org/springframework/ui/freemarker/SpringTemplateLoader.java <ide> public SpringTemplateLoader(ResourceLoader resourceLoader, String templateLoader <ide> } <ide> } <ide> <add> @Override <ide> public Object findTemplateSource(String name) throws IOException { <ide> if (logger.isDebugEnabled()) { <ide> logger.debug("Looking for FreeMarker template with name [" + name + "]"); <ide> public Object findTemplateSource(String name) throws IOException { <ide> return (resource.exists() ? resource : null); <ide> } <ide> <add> @Override <ide> public Reader getReader(Object templateSource, String encoding) throws IOException { <ide> Resource resource = (Resource) templateSource; <ide> try { <ide> public Reader getReader(Object templateSource, String encoding) throws IOExcepti <ide> } <ide> <ide> <add> @Override <ide> public long getLastModified(Object templateSource) { <ide> Resource resource = (Resource) templateSource; <ide> try { <ide> public long getLastModified(Object templateSource) { <ide> } <ide> } <ide> <add> @Override <ide> public void closeTemplateSource(Object templateSource) throws IOException { <ide> } <ide> <ide><path>spring-context-support/src/main/java/org/springframework/ui/velocity/VelocityEngineFactoryBean.java <ide> public class VelocityEngineFactoryBean extends VelocityEngineFactory <ide> private VelocityEngine velocityEngine; <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() throws IOException, VelocityException { <ide> this.velocityEngine = createVelocityEngine(); <ide> } <ide> <ide> <add> @Override <ide> public VelocityEngine getObject() { <ide> return this.velocityEngine; <ide> } <ide> <add> @Override <ide> public Class<? extends VelocityEngine> getObjectType() { <ide> return VelocityEngine.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-context/src/main/java/org/springframework/cache/annotation/AbstractCachingConfiguration.java <ide> public abstract class AbstractCachingConfiguration implements ImportAware { <ide> @Autowired(required=false) <ide> private Collection<CachingConfigurer> cachingConfigurers; <ide> <add> @Override <ide> public void setImportMetadata(AnnotationMetadata importMetadata) { <ide> this.enableCaching = AnnotationAttributes.fromMap( <ide> importMetadata.getAnnotationAttributes(EnableCaching.class.getName(), false)); <ide><path>spring-context/src/main/java/org/springframework/cache/annotation/CachingConfigurationSelector.java <ide> public class CachingConfigurationSelector extends AdviceModeImportSelector<Enabl <ide> * @return {@link ProxyCachingConfiguration} or {@code AspectJCacheConfiguration} for <ide> * {@code PROXY} and {@code ASPECTJ} values of {@link EnableCaching#mode()}, respectively <ide> */ <add> @Override <ide> public String[] selectImports(AdviceMode adviceMode) { <ide> switch (adviceMode) { <ide> case PROXY: <ide><path>spring-context/src/main/java/org/springframework/cache/annotation/SpringCacheAnnotationParser.java <ide> @SuppressWarnings("serial") <ide> public class SpringCacheAnnotationParser implements CacheAnnotationParser, Serializable { <ide> <add> @Override <ide> public Collection<CacheOperation> parseCacheAnnotations(AnnotatedElement ae) { <ide> Collection<CacheOperation> ops = null; <ide> <ide><path>spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCache.java <ide> public ConcurrentMapCache(String name, ConcurrentMap<Object, Object> store, bool <ide> } <ide> <ide> <add> @Override <ide> public String getName() { <ide> return this.name; <ide> } <ide> <add> @Override <ide> public ConcurrentMap getNativeCache() { <ide> return this.store; <ide> } <ide> public boolean isAllowNullValues() { <ide> return this.allowNullValues; <ide> } <ide> <add> @Override <ide> public ValueWrapper get(Object key) { <ide> Object value = this.store.get(key); <ide> return (value != null ? new SimpleValueWrapper(fromStoreValue(value)) : null); <ide> } <ide> <add> @Override <ide> public void put(Object key, Object value) { <ide> this.store.put(key, toStoreValue(value)); <ide> } <ide> <add> @Override <ide> public void evict(Object key) { <ide> this.store.remove(key); <ide> } <ide> <add> @Override <ide> public void clear() { <ide> this.store.clear(); <ide> } <ide><path>spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheFactoryBean.java <ide> public void setAllowNullValues(boolean allowNullValues) { <ide> this.allowNullValues = allowNullValues; <ide> } <ide> <add> @Override <ide> public void setBeanName(String beanName) { <ide> if (!StringUtils.hasLength(this.name)) { <ide> setName(beanName); <ide> } <ide> } <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> this.cache = (this.store != null ? new ConcurrentMapCache(this.name, this.store, this.allowNullValues) : <ide> new ConcurrentMapCache(this.name, this.allowNullValues)); <ide> } <ide> <ide> <add> @Override <ide> public ConcurrentMapCache getObject() { <ide> return this.cache; <ide> } <ide> <add> @Override <ide> public Class<?> getObjectType() { <ide> return ConcurrentMapCache.class; <ide> } <ide> <add> @Override <ide> public boolean isSingleton() { <ide> return true; <ide> } <ide><path>spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java <ide> public void setCacheNames(Collection<String> cacheNames) { <ide> } <ide> } <ide> <add> @Override <ide> public Collection<String> getCacheNames() { <ide> return Collections.unmodifiableSet(this.cacheMap.keySet()); <ide> } <ide> <add> @Override <ide> public Cache getCache(String name) { <ide> Cache cache = this.cacheMap.get(name); <ide> if (cache == null && this.dynamic) { <ide><path>spring-context/src/main/java/org/springframework/cache/config/AnnotationDrivenCacheBeanDefinitionParser.java <ide> class AnnotationDrivenCacheBeanDefinitionParser implements BeanDefinitionParser <ide> * {@link AopNamespaceUtils#registerAutoProxyCreatorIfNecessary <ide> * register an AutoProxyCreator} with the container as necessary. <ide> */ <add> @Override <ide> public BeanDefinition parse(Element element, ParserContext parserContext) { <ide> String mode = element.getAttribute("mode"); <ide> if ("aspectj".equals(mode)) { <ide><path>spring-context/src/main/java/org/springframework/cache/config/CacheNamespaceHandler.java <ide> static BeanDefinition parseKeyGenerator(Element element, BeanDefinition def) { <ide> return def; <ide> } <ide> <add> @Override <ide> public void init() { <ide> registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenCacheBeanDefinitionParser()); <ide> registerBeanDefinitionParser("advice", new CacheAdviceParser()); <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/AbstractFallbackCacheOperationSource.java <ide> public abstract class AbstractFallbackCacheOperationSource implements CacheOpera <ide> * @return {@link CacheOperation} for this method, or {@code null} if the method <ide> * is not cacheable <ide> */ <add> @Override <ide> public Collection<CacheOperation> getCacheOperations(Method method, Class<?> targetClass) { <ide> // First, see if we have a cached value. <ide> Object cacheKey = getCacheKey(method, targetClass); <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/BeanFactoryCacheOperationSourceAdvisor.java <ide> public void setClassFilter(ClassFilter classFilter) { <ide> this.pointcut.setClassFilter(classFilter); <ide> } <ide> <add> @Override <ide> public Pointcut getPointcut() { <ide> return this.pointcut; <ide> } <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java <ide> public KeyGenerator getKeyGenerator() { <ide> return this.keyGenerator; <ide> } <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> if (this.cacheManager == null) { <ide> throw new IllegalStateException("'cacheManager' is required"); <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CacheInterceptor.java <ide> private static class ThrowableWrapper extends RuntimeException { <ide> } <ide> } <ide> <add> @Override <ide> public Object invoke(final MethodInvocation invocation) throws Throwable { <ide> Method method = invocation.getMethod(); <ide> <ide> Invoker aopAllianceInvoker = new Invoker() { <add> @Override <ide> public Object invoke() { <ide> try { <ide> return invocation.proceed(); <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationSourcePointcut.java <ide> @SuppressWarnings("serial") <ide> abstract class CacheOperationSourcePointcut extends StaticMethodMatcherPointcut implements Serializable { <ide> <add> @Override <ide> public boolean matches(Method method, Class<?> targetClass) { <ide> CacheOperationSource cas = getCacheOperationSource(); <ide> return (cas != null && !CollectionUtils.isEmpty(cas.getCacheOperations(method, targetClass))); <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CompositeCacheOperationSource.java <ide> public final CacheOperationSource[] getCacheOperationSources() { <ide> return this.cacheOperationSources; <ide> } <ide> <add> @Override <ide> public Collection<CacheOperation> getCacheOperations(Method method, Class<?> targetClass) { <ide> Collection<CacheOperation> ops = null; <ide> <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/DefaultKeyGenerator.java <ide> public class DefaultKeyGenerator implements KeyGenerator { <ide> public static final int NO_PARAM_KEY = 0; <ide> public static final int NULL_PARAM_KEY = 53; <ide> <add> @Override <ide> public Object generate(Object target, Method method, Object... params) { <ide> if (params.length == 1) { <ide> return (params[0] == null ? NULL_PARAM_KEY : params[0]); <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/NameMatchCacheOperationSource.java <ide> public void addCacheMethod(String methodName, Collection<CacheOperation> ops) { <ide> this.nameMap.put(methodName, ops); <ide> } <ide> <add> @Override <ide> public Collection<CacheOperation> getCacheOperations(Method method, Class<?> targetClass) { <ide> // look for direct name match <ide> String methodName = method.getName(); <ide><path>spring-context/src/main/java/org/springframework/cache/support/AbstractCacheManager.java <ide> public abstract class AbstractCacheManager implements CacheManager, Initializing <ide> private Set<String> cacheNames = new LinkedHashSet<String>(16); <ide> <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> Collection<? extends Cache> caches = loadCaches(); <ide> <ide> protected Cache decorateCache(Cache cache) { <ide> } <ide> <ide> <add> @Override <ide> public Cache getCache(String name) { <ide> return this.cacheMap.get(name); <ide> } <ide> <add> @Override <ide> public Collection<String> getCacheNames() { <ide> return Collections.unmodifiableSet(this.cacheNames); <ide> } <ide><path>spring-context/src/main/java/org/springframework/cache/support/CompositeCacheManager.java <ide> public void setFallbackToNoOpCache(boolean fallbackToNoOpCache) { <ide> this.fallbackToNoOpCache = fallbackToNoOpCache; <ide> } <ide> <add> @Override <ide> public void afterPropertiesSet() { <ide> if (this.fallbackToNoOpCache) { <ide> this.cacheManagers.add(new NoOpCacheManager()); <ide> } <ide> } <ide> <ide> <add> @Override <ide> public Cache getCache(String name) { <ide> for (CacheManager cacheManager : this.cacheManagers) { <ide> Cache cache = cacheManager.getCache(name); <ide> public Cache getCache(String name) { <ide> return null; <ide> } <ide> <add> @Override <ide> public Collection<String> getCacheNames() { <ide> List<String> names = new ArrayList<String>(); <ide> for (CacheManager manager : this.cacheManagers) { <ide><path>spring-context/src/main/java/org/springframework/cache/support/NoOpCacheManager.java <ide> public class NoOpCacheManager implements CacheManager { <ide> * This implementation always returns a {@link Cache} implementation that will not store items. <ide> * Additionally, the request cache will be remembered by the manager for consistency. <ide> */ <add> @Override <ide> public Cache getCache(String name) { <ide> Cache cache = this.caches.get(name); <ide> if (cache == null) { <ide> public Cache getCache(String name) { <ide> /** <ide> * This implementation returns the name of the caches previously requested. <ide> */ <add> @Override <ide> public Collection<String> getCacheNames() { <ide> synchronized (this.cacheNames) { <ide> return Collections.unmodifiableSet(this.cacheNames); <ide> public NoOpCache(String name) { <ide> this.name = name; <ide> } <ide> <add> @Override <ide> public void clear() { <ide> } <ide> <add> @Override <ide> public void evict(Object key) { <ide> } <ide> <add> @Override <ide> public ValueWrapper get(Object key) { <ide> return null; <ide> } <ide> <add> @Override <ide> public String getName() { <ide> return this.name; <ide> } <ide> <add> @Override <ide> public Object getNativeCache() { <ide> return null; <ide> } <ide> <add> @Override <ide> public void put(Object key, Object value) { <ide> } <ide> } <ide><path>spring-context/src/main/java/org/springframework/cache/support/SimpleValueWrapper.java <ide> public SimpleValueWrapper(Object value) { <ide> /** <ide> * Simply returns the value as given at construction time. <ide> */ <add> @Override <ide> public Object get() { <ide> return this.value; <ide> } <ide><path>spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java <ide> public interface ConfigurableApplicationContext extends ApplicationContext, Life <ide> /** <ide> * Return the Environment for this application context in configurable form. <ide> */ <add> @Override <ide> ConfigurableEnvironment getEnvironment(); <ide> <ide> /** <ide> public interface ConfigurableApplicationContext extends ApplicationContext, Life <ide> * <p>This method can be called multiple times without side effects: Subsequent <ide> * {@code close} calls on an already closed context will be ignored. <ide> */ <add> @Override <ide> void close(); <ide> <ide> /** <ide><path>spring-context/src/main/java/org/springframework/context/access/ContextBeanFactoryReference.java <ide> public ContextBeanFactoryReference(ApplicationContext applicationContext) { <ide> } <ide> <ide> <add> @Override <ide> public BeanFactory getFactory() { <ide> if (this.applicationContext == null) { <ide> throw new IllegalStateException( <ide> public BeanFactory getFactory() { <ide> return this.applicationContext; <ide> } <ide> <add> @Override <ide> public void release() { <ide> if (this.applicationContext != null) { <ide> ApplicationContext savedCtx; <ide><path>spring-context/src/main/java/org/springframework/context/access/ContextJndiBeanFactoryLocator.java <ide> public class ContextJndiBeanFactoryLocator extends JndiLocatorSupport implements <ide> * will be created from the combined resources. <ide> * @see #createBeanFactory <ide> */ <add> @Override <ide> public BeanFactoryReference useBeanFactory(String factoryKey) throws BeansException { <ide> try { <ide> String beanFactoryPath = lookup(factoryKey, String.class); <ide><path>spring-context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java <ide> protected String getAdviceModeAttributeName() { <ide> * on the importing {@code @Configuration} class or if {@link #selectImports(AdviceMode)} <ide> * returns {@code null} <ide> */ <add> @Override <ide> public final String[] selectImports(AnnotationMetadata importingClassMetadata) { <ide> Class<?> annoType = GenericTypeResolver.resolveTypeArgument(this.getClass(), AdviceModeImportSelector.class); <ide> <ide><path>spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java <ide> public class AnnotationBeanNameGenerator implements BeanNameGenerator { <ide> private static final String COMPONENT_ANNOTATION_CLASSNAME = "org.springframework.stereotype.Component"; <ide> <ide> <add> @Override <ide> public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) { <ide> if (definition instanceof AnnotatedBeanDefinition) { <ide> String beanName = determineBeanNameFromAnnotation((AnnotatedBeanDefinition) definition); <ide><path>spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigBeanDefinitionParser.java <ide> */ <ide> public class AnnotationConfigBeanDefinitionParser implements BeanDefinitionParser { <ide> <add> @Override <ide> public BeanDefinition parse(Element element, ParserContext parserContext) { <ide> Object source = parserContext.extractSource(element); <ide> <ide><path>spring-context/src/main/java/org/springframework/context/annotation/AnnotationScopeMetadataResolver.java <ide> public void setScopeAnnotationType(Class<? extends Annotation> scopeAnnotationTy <ide> } <ide> <ide> <add> @Override <ide> public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) { <ide> ScopeMetadata metadata = new ScopeMetadata(); <ide> if (definition instanceof AnnotatedBeanDefinition) { <ide><path>spring-context/src/main/java/org/springframework/context/annotation/AspectJAutoProxyRegistrar.java <ide> class AspectJAutoProxyRegistrar implements ImportBeanDefinitionRegistrar { <ide> * of the @{@link EnableAspectJAutoProxy#proxyTargetClass()} attribute on the importing <ide> * {@code @Configuration} class. <ide> */ <add> @Override <ide> public void registerBeanDefinitions( <ide> AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { <ide> <ide><path>spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java <ide> public class AutoProxyRegistrar implements ImportBeanDefinitionRegistrar { <ide> * {@code proxyTargetClass} attributes, the APC can be registered and configured all <ide> * the same. <ide> */ <add> @Override <ide> public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { <ide> boolean candidateFound = false; <ide> Set<String> annoTypes = importingClassMetadata.getAnnotationTypes(); <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java <ide> public ClassPathScanningCandidateComponentProvider(boolean useDefaultFilters, En <ide> * @see org.springframework.core.io.support.ResourcePatternResolver <ide> * @see org.springframework.core.io.support.PathMatchingResourcePatternResolver <ide> */ <add> @Override <ide> public void setResourceLoader(ResourceLoader resourceLoader) { <ide> this.resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader); <ide> this.metadataReaderFactory = new CachingMetadataReaderFactory(resourceLoader); <ide> public void setEnvironment(Environment environment) { <ide> this.environment = environment; <ide> } <ide> <add> @Override <ide> public final Environment getEnvironment() { <ide> return this.environment; <ide> } <ide><path>spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java <ide> public void setResourceFactory(BeanFactory resourceFactory) { <ide> this.resourceFactory = resourceFactory; <ide> } <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) throws BeansException { <ide> Assert.notNull(beanFactory, "BeanFactory must not be null"); <ide> this.beanFactory = beanFactory; <ide> public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, C <ide> } <ide> } <ide> <add> @Override <ide> public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException { <ide> return null; <ide> } <ide> <add> @Override <ide> public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException { <ide> return true; <ide> } <ide> <add> @Override <ide> public PropertyValues postProcessPropertyValues( <ide> PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) throws BeansException { <ide> <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ComponentScanBeanDefinitionParser.java <ide> public class ComponentScanBeanDefinitionParser implements BeanDefinitionParser { <ide> private static final String FILTER_EXPRESSION_ATTRIBUTE = "expression"; <ide> <ide> <add> @Override <ide> public BeanDefinition parse(Element element, ParserContext parserContext) { <ide> String[] basePackages = StringUtils.tokenizeToStringArray(element.getAttribute(BASE_PACKAGE_ATTRIBUTE), <ide> ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS); <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConditionalAnnotationHelper.java <ide> private Environment deduceEnvironment(BeanDefinitionRegistry registry) { <ide> return null; <ide> } <ide> <add> @Override <ide> public BeanDefinitionRegistry getRegistry() { <ide> return this.registry; <ide> } <ide> <add> @Override <ide> public Environment getEnvironment() { <ide> return this.environment; <ide> } <ide> <add> @Override <ide> public ConfigurableListableBeanFactory getBeanFactory() { <ide> Assert.state(this.beanFactory != null, "Unable to locate the BeanFactory"); <ide> return this.beanFactory; <ide> } <ide> <add> @Override <ide> public ResourceLoader getResourceLoader() { <ide> if (registry instanceof ResourceLoader) { <ide> return (ResourceLoader) registry; <ide> } <ide> return null; <ide> } <ide> <add> @Override <ide> public ClassLoader getClassLoader() { <ide> ResourceLoader resourceLoader = getResourceLoader(); <ide> return (resourceLoader == null ? null : resourceLoader.getClassLoader()); <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java <ide> private ConfigurationClassBeanDefinition(ConfigurationClassBeanDefinition origin <ide> this.annotationMetadata = original.annotationMetadata; <ide> } <ide> <add> @Override <ide> public AnnotationMetadata getMetadata() { <ide> return this.annotationMetadata; <ide> } <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java <ide> public Class<?>[] getCallbackTypes() { <ide> private static class DisposableBeanMethodInterceptor implements MethodInterceptor, <ide> ConditionalCallback { <ide> <add> @Override <ide> public boolean isMatch(Method candidateMethod) { <ide> return candidateMethod.getName().equals("destroy") <ide> && candidateMethod.getParameterTypes().length == 0 <ide> && DisposableBean.class.isAssignableFrom(candidateMethod.getDeclaringClass()); <ide> } <ide> <add> @Override <ide> public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { <ide> Enhancer.registerStaticCallbacks(obj.getClass(), null); <ide> // does the actual (non-CGLIB) superclass actually implement DisposableBean? <ide> public Object intercept(Object obj, Method method, Object[] args, MethodProxy pr <ide> private static class BeanFactoryAwareMethodInterceptor implements MethodInterceptor, <ide> ConditionalCallback { <ide> <add> @Override <ide> public boolean isMatch(Method candidateMethod) { <ide> return candidateMethod.getName().equals("setBeanFactory") <ide> && candidateMethod.getParameterTypes().length == 1 <ide> && candidateMethod.getParameterTypes()[0].equals(BeanFactory.class) <ide> && BeanFactoryAware.class.isAssignableFrom(candidateMethod.getDeclaringClass()); <ide> } <ide> <add> @Override <ide> public Object intercept(Object obj, Method method, Object[] args, <ide> MethodProxy proxy) throws Throwable { <ide> Field field = obj.getClass().getDeclaredField(BEAN_FACTORY_FIELD); <ide> public Object intercept(Object obj, Method method, Object[] args, <ide> */ <ide> private static class BeanMethodInterceptor implements MethodInterceptor, ConditionalCallback { <ide> <add> @Override <ide> public boolean isMatch(Method candidateMethod) { <ide> return BeanAnnotationHelper.isBeanAnnotated(candidateMethod); <ide> } <ide> public boolean isMatch(Method candidateMethod) { <ide> * invoking the super implementation of the proxied method i.e., the actual <ide> * {@code @Bean} method. <ide> */ <add> @Override <ide> public Object intercept(Object enhancedConfigInstance, Method beanMethod, Object[] beanMethodArgs, <ide> MethodProxy cglibMethodProxy) throws Throwable { <ide> <ide> private Object enhanceFactoryBean(Class<?> fbClass, final ConfigurableBeanFactor <ide> enhancer.setSuperclass(fbClass); <ide> enhancer.setUseFactory(false); <ide> enhancer.setCallback(new MethodInterceptor() { <add> @Override <ide> public Object intercept(Object obj, Method method, Object[] args, <ide> MethodProxy proxy) throws Throwable { <ide> if (method.getName().equals("getObject") && args.length == 0) { <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java <ide> class ConfigurationClassParser { <ide> <ide> private static final Comparator<DeferredImportSelectorHolder> DEFERRED_IMPORT_COMPARATOR = <ide> new Comparator<ConfigurationClassParser.DeferredImportSelectorHolder>() { <add> @Override <ide> public int compare(DeferredImportSelectorHolder o1, <ide> DeferredImportSelectorHolder o2) { <ide> return AnnotationAwareOrderComparator.INSTANCE.compare( <ide> public void registerImport(String importingClass, String importedClass) { <ide> this.imports.put(importedClass, importingClass); <ide> } <ide> <add> @Override <ide> public String getImportingClassFor(String importedClass) { <ide> return this.imports.get(importedClass); <ide> } <ide> public String getImportingClassFor(String importedClass) { <ide> public boolean contains(Object elem) { <ide> ConfigurationClass configClass = (ConfigurationClass) elem; <ide> Comparator<ConfigurationClass> comparator = new Comparator<ConfigurationClass>() { <add> @Override <ide> public int compare(ConfigurationClass first, ConfigurationClass second) { <ide> return first.getMetadata().getClassName().equals(second.getMetadata().getClassName()) ? 0 : 1; <ide> } <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java <ide> public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) { <ide> this.importBeanNameGenerator = beanNameGenerator; <ide> } <ide> <add> @Override <ide> public void setEnvironment(Environment environment) { <ide> Assert.notNull(environment, "Environment must not be null"); <ide> this.environment = environment; <ide> } <ide> <add> @Override <ide> public void setResourceLoader(ResourceLoader resourceLoader) { <ide> Assert.notNull(resourceLoader, "ResourceLoader must not be null"); <ide> this.resourceLoader = resourceLoader; <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader beanClassLoader) { <ide> this.beanClassLoader = beanClassLoader; <ide> if (!this.setMetadataReaderFactoryCalled) { <ide> public void setBeanClassLoader(ClassLoader beanClassLoader) { <ide> /** <ide> * Derive further bean definitions from the configuration classes in the registry. <ide> */ <add> @Override <ide> public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) { <ide> RootBeanDefinition iabpp = new RootBeanDefinition(ImportAwareBeanPostProcessor.class); <ide> iabpp.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); <ide> public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) { <ide> * Prepare the Configuration classes for servicing bean requests at runtime <ide> * by replacing them with CGLIB-enhanced subclasses. <ide> */ <add> @Override <ide> public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { <ide> int factoryId = System.identityHashCode(beanFactory); <ide> if (this.factoriesPostProcessed.contains(factoryId)) { <ide> private static class ImportAwareBeanPostProcessor implements PriorityOrdered, Be <ide> <ide> private BeanFactory beanFactory; <ide> <add> @Override <ide> public void setBeanFactory(BeanFactory beanFactory) throws BeansException { <ide> this.beanFactory = beanFactory; <ide> } <ide> <add> @Override <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { <ide> if (bean instanceof ImportAware) { <ide> ImportRegistry importRegistry = this.beanFactory.getBean(IMPORT_REGISTRY_BEAN_NAME, ImportRegistry.class); <ide> public Object postProcessBeforeInitialization(Object bean, String beanName) thro <ide> return bean; <ide> } <ide> <add> @Override <ide> public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { <ide> return bean; <ide> } <ide> <add> @Override <ide> public int getOrder() { <ide> return Ordered.HIGHEST_PRECEDENCE; <ide> } <ide><path>spring-context/src/main/java/org/springframework/context/annotation/Jsr330ScopeMetadataResolver.java <ide> protected String resolveScopeName(String annotationType) { <ide> } <ide> <ide> <add> @Override <ide> public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) { <ide> ScopeMetadata metadata = new ScopeMetadata(); <ide> metadata.setScopeName(BeanDefinition.SCOPE_PROTOTYPE); <ide><path>spring-context/src/main/java/org/springframework/context/annotation/LoadTimeWeavingConfiguration.java <ide> public class LoadTimeWeavingConfiguration implements ImportAware, BeanClassLoade <ide> <ide> private ClassLoader beanClassLoader; <ide> <add> @Override <ide> public void setImportMetadata(AnnotationMetadata importMetadata) { <ide> this.enableLTW = MetadataUtils.attributesFor(importMetadata, EnableLoadTimeWeaving.class); <ide> Assert.notNull(this.enableLTW, <ide> "@EnableLoadTimeWeaving is not present on importing class " + <ide> importMetadata.getClassName()); <ide> } <ide> <add> @Override <ide> public void setBeanClassLoader(ClassLoader beanClassLoader) { <ide> this.beanClassLoader = beanClassLoader; <ide> }
300
Javascript
Javascript
fix jshint warnings and remove commented code
8226f3432b9a71f2f9c0c616161de328378985da
<ide><path>src/controllers/controller.bar.js <ide> module.exports = function(Chart) { <ide> var base = 0; <ide> <ide> if (xScale.options.stacked) { <add> var chart = me.chart; <add> var datasets = chart.data.datasets; <add> var value = Number(datasets[datasetIndex].data[index]); <ide> <del> var value = Number(me.chart.data.datasets[datasetIndex].data[index]); <del> <del> /*if (value < 0) { <del> for (var i = 0; i < datasetIndex; i++) { <del> var negDS = me.chart.data.datasets[i]; <del> var negDSMeta = me.chart.getDatasetMeta(i); <del> if (negDSMeta.bar && negDSMeta.xAxisID === xScale.id && me.chart.isDatasetVisible(i)) { <del> base += negDS.data[index] < 0 ? negDS.data[index] : 0; <del> } <del> } <del> } else { <del> for (var j = 0; j < datasetIndex; j++) { <del> var posDS = me.chart.data.datasets[j]; <del> var posDSMeta = me.chart.getDatasetMeta(j); <del> if (posDSMeta.bar && posDSMeta.xAxisID === xScale.id && me.chart.isDatasetVisible(j)) { <del> base += posDS.data[index] > 0 ? posDS.data[index] : 0; <del> } <del> } <del> }*/ <ide> for (var i = 0; i < datasetIndex; i++) { <ide> var currentDs = datasets[i]; <ide> var currentDsMeta = chart.getDatasetMeta(i);
1
Ruby
Ruby
remove default argument
dc9872eb834444664cc423a3e1ff167055ebd078
<ide><path>Library/Homebrew/build_options.rb <ide> def initialize_copy(other) <ide> @args = other.args.dup <ide> end <ide> <del> def add name, description=nil <add> def add(name, description) <ide> description ||= case name.to_s <ide> when "universal" then "Build a universal binary" <ide> when "32-bit" then "Build 32-bit only"
1
Javascript
Javascript
fix minor bug in concatenated modules
9aba345ae76a97e61d36825898be045eee0c8d1b
<ide><path>lib/optimize/ConcatenatedModule.js <ide> const getExternalImport = ( <ide> const used = <ide> exportName.length === 0 || <ide> importedModule.getUsedName(moduleGraph, exportName); <del> if (!used) return "/* unused reexport */undefined"; <add> if (!used) return "/* unused export */undefined"; <ide> const comment = arrayEquals(used, exportName) <ide> ? "" <ide> : Template.toNormalComment(`${exportName.join(".")}`); <ide> class HarmonyExportExpressionDependencyConcatenatedTemplate extends DependencyTe <ide> <ide> if (module === this.rootModule) { <ide> const used = module.getUsedName(moduleGraph, "default"); <del> const map = new Map(); <del> map.set(used, "__WEBPACK_MODULE_DEFAULT_EXPORT__"); <del> initFragments.push( <del> new HarmonyExportInitFragment(module.exportsArgument, map) <del> ); <add> if (used) { <add> const map = new Map(); <add> map.set(used, "__WEBPACK_MODULE_DEFAULT_EXPORT__"); <add> initFragments.push( <add> new HarmonyExportInitFragment(module.exportsArgument, map) <add> ); <add> } <ide> } <ide> <ide> const content = `/* harmony default export */ ${
1
Javascript
Javascript
remove redirect build on dev
d1c26a09dca14bc0600f8af8838c5f016dbbbdcc
<ide><path>tools/scripts/ensure-env.js <ide> const { <ide> API_LOCATION: api, <ide> FORUM_LOCATION: forum, <ide> FORUM_PROXY_LOCATION: forumProxy, <del> LOCALE: locale <add> LOCALE: locale, <add> NODE_ENV: NODE_ENV <ide> } = process.env; <ide> <ide> const locations = { <ide> const clientStaticPath = path.resolve(clientPath, 'static'); <ide> const globalConfigPath = path.resolve(__dirname, '../../config'); <ide> const env = Object.assign(locations, {locale}); <ide> <del>const redirects = createRedirects({ api, home, forum, forumProxy }); <del> <del>fs.writeFile(`${clientStaticPath}/_redirects`, redirects, function(err) { <del> if (err) { <del> log('Error'); <del> console.error(err); <del> } <del> log('_redirects written'); <del>}); <add>if (NODE_ENV === 'production') { <add> const redirects = createRedirects({ api, home, forum, forumProxy }); <add> fs.writeFile(`${clientStaticPath}/_redirects`, redirects, function(err) { <add> if (err) { <add> log('Error'); <add> console.error(err); <add> } <add> log('_redirects written'); <add> }); <add>} else { <add> log(`ignoring creation of redirect file in ${NODE_ENV}`); <add>} <ide> <ide> fs.access(`${apiPath}/server/resources/pathMigration.json`, err => { <ide> if (err) {
1
Javascript
Javascript
fix axis line width when option is an array
f6d9a39cb8e8661e1d6a733d4b77fb3f3238935a
<ide><path>src/core/core.scale.js <ide> module.exports = Element.extend({ <ide> <ide> var itemsToDraw = []; <ide> <del> var axisWidth = me.options.gridLines.lineWidth; <add> var axisWidth = helpers.valueAtIndexOrDefault(me.options.gridLines.lineWidth, 0); <ide> var xTickStart = options.position === 'right' ? me.left : me.right - axisWidth - tl; <ide> var xTickEnd = options.position === 'right' ? me.left + tl : me.right; <ide> var yTickStart = options.position === 'bottom' ? me.top + axisWidth : me.bottom - tl - axisWidth;
1
Ruby
Ruby
add cop to check `depends_on` order and tests
09f343d4961c454100c01390761c8ebc153fe594
<ide><path>Library/Homebrew/rubocops.rb <ide> require_relative "./rubocops/formula_desc_cop" <ide> require_relative "./rubocops/components_order_cop" <ide> require_relative "./rubocops/components_redundancy_cop" <add>require_relative "./rubocops/dependency_order_cop" <ide> require_relative "./rubocops/homepage_cop" <ide> require_relative "./rubocops/text_cop" <ide> require_relative "./rubocops/caveats_cop" <ide><path>Library/Homebrew/rubocops/dependency_order_cop.rb <add>require_relative "./extend/formula_cop" <add> <add>module RuboCop <add> module Cop <add> module NewFormulaAudit <add> # This cop checks for correct order of `depends_on` in a Formula <add> # <add> # precedence order: <add> # build-time > run-time > normal > recommended > optional <add> class DependencyOrder < FormulaCop <add> def audit_formula(_node, _class_node, _parent_class_node, body_node) <add> check_dependency_nodes_order(body_node) <add> [:devel, :head, :stable].each do |block_name| <add> block = find_block(body_node, block_name) <add> next unless block <add> check_dependency_nodes_order(block.body) <add> end <add> end <add> <add> def check_dependency_nodes_order(parent_node) <add> return if parent_node.nil? <add> dependency_nodes = fetch_depends_on_nodes(parent_node) <add> ordered = dependency_nodes.sort { |a, b| sort_by_dependency_name(a, b) } <add> ordered = sort_dependencies_by_type(ordered) <add> sort_conditional_dependencies!(ordered) <add> verify_order_in_source(ordered) <add> end <add> <add> # Match all `depends_on` nodes among childnodes of given parent node <add> def fetch_depends_on_nodes(parent_node) <add> parent_node.each_child_node.select { |x| depends_on_node?(x) } <add> end <add> <add> def sort_by_dependency_name(a, b) <add> a_name = dependency_name(a) <add> b_name = dependency_name(b) <add> if a_name < b_name <add> -1 <add> elsif a_name > b_name <add> 1 <add> else <add> 0 <add> end <add> end <add> <add> # Separate dependencies according to precedence order: <add> # build-time > run-time > normal > recommended > optional <add> def sort_dependencies_by_type(dependency_nodes) <add> ordered = [] <add> ordered.concat(dependency_nodes.select { |dep| buildtime_dependency? dep }.to_a) <add> ordered.concat(dependency_nodes.select { |dep| runtime_dependency? dep }.to_a) <add> ordered.concat(dependency_nodes.reject { |dep| negate_normal_dependency? dep }.to_a) <add> ordered.concat(dependency_nodes.select { |dep| recommended_dependency? dep }.to_a) <add> ordered.concat(dependency_nodes.select { |dep| optional_dependency? dep }.to_a) <add> end <add> <add> # `depends_on :apple if build.with? "foo"` should always be defined <add> # after `depends_on :foo` <add> # This method reorders dependencies array according to above rule <add> def sort_conditional_dependencies!(ordered) <add> length = ordered.size <add> idx = 0 <add> while idx < length <add> idx1, idx2 = nil <add> ordered.each_with_index do |dep, pos| <add> idx = pos+1 <add> match_nodes = build_with_dependency_name(dep) <add> idx1 = pos if match_nodes && !match_nodes.empty? <add> next unless idx1 <add> idx2 = nil <add> ordered.drop(idx1+1).each_with_index do |dep2, pos2| <add> next unless match_nodes.index(dependency_name(dep2)) <add> idx2 = pos2 if idx2.nil? || pos2 > idx2 <add> end <add> break if idx2 <add> end <add> insert_after!(ordered, idx1, idx2+idx1) if idx2 <add> end <add> ordered <add> end <add> <add> # Verify actual order of sorted `depends_on` nodes in source code <add> # Else raise RuboCop problem <add> def verify_order_in_source(ordered) <add> ordered.each_with_index do |dependency_node_1, idx| <add> l1 = line_number(dependency_node_1) <add> dependency_node_2 = nil <add> ordered.drop(idx+1).each do |node2| <add> l2 = line_number(node2) <add> dependency_node_2 = node2 if l2 < l1 <add> end <add> next unless dependency_node_2 <add> @offensive_nodes = [dependency_node_1, dependency_node_2] <add> component_problem dependency_node_1, dependency_node_2 <add> end <add> end <add> <add> # Node pattern method to match <add> # `depends_on` variants <add> def_node_matcher :depends_on_node?, <<~EOS <add> {(if _ (send nil? :depends_on ...) nil?) <add> (send nil? :depends_on ...)} <add> EOS <add> <add> def_node_search :buildtime_dependency?, "(sym :build)" <add> <add> def_node_search :recommended_dependency?, "(sym :recommended)" <add> <add> def_node_search :runtime_dependency?, "(sym :run)" <add> <add> def_node_search :optional_dependency?, "(sym :optional)" <add> <add> def_node_search :negate_normal_dependency?, "(sym {:build :recommended :run :optional})" <add> <add> # Node pattern method to extract `name` in `depends_on :name` <add> def_node_search :dependency_name_node, <<~EOS <add> {(send nil? :depends_on {(hash (pair $_ _)) $({str sym} _)}) <add> (if _ (send nil? :depends_on {(hash (pair $_ _)) $({str sym} _)}) nil?)} <add> EOS <add> <add> # Node pattern method to extract `name` in `build.with? :name` <add> def_node_search :build_with_dependency_node, <<~EOS <add> (send (send nil? :build) :with? $({str sym} _)) <add> EOS <add> <add> def insert_after!(arr, idx1, idx2) <add> arr.insert(idx2+1, arr.delete_at(idx1)) <add> end <add> <add> def build_with_dependency_name(node) <add> match_nodes = build_with_dependency_node(node) <add> match_nodes = match_nodes.to_a.delete_if(&:nil?) <add> match_nodes.map { |n| string_content(n) } unless match_nodes.empty? <add> end <add> <add> def dependency_name(dependency_node) <add> match_node = dependency_name_node(dependency_node).to_a.first <add> string_content(match_node) if match_node <add> end <add> <add> def autocorrect(_node) <add> succeeding_node = @offensive_nodes[0] <add> preceding_node = @offensive_nodes[1] <add> lambda do |corrector| <add> reorder_components(corrector, succeeding_node, preceding_node) <add> end <add> end <add> <add> private <add> <add> def component_problem(c1, c2) <add> offending_node(c1) <add> problem "dependency \"#{dependency_name(c1)}\" (line #{line_number(c1)}) should be put before dependency \"#{dependency_name(c2)}\" (line #{line_number(c2)})" <add> end <add> <add> # Reorder two nodes in the source, using the corrector instance in autocorrect method <add> def reorder_components(corrector, node1, node2) <add> indentation = " " * (start_column(node2) - line_start_column(node2)) <add> line_breaks = "\n" <add> corrector.insert_before(node2.source_range, node1.source + line_breaks + indentation) <add> corrector.remove(range_with_surrounding_space(range: node1.source_range, side: :left)) <add> end <add> end <add> end <add> end <add>end <ide><path>Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb <add>require_relative "../../rubocops/dependency_order_cop" <add> <add>describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do <add> subject(:cop) { described_class.new } <add> <add> context "depends_on" do <add> it "wrong conditional depends_on order" do <add> expect_offense(<<~RUBY) <add> class Foo < Formula <add> homepage "http://example.com" <add> url "http://example.com/foo-1.0.tgz" <add> depends_on "apple" if build.with? "foo" <add> depends_on "foo" => :optional <add> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 5) should be put before dependency "apple" (line 4) <add> end <add> RUBY <add> end <add> <add> it "wrong alphabetical depends_on order" do <add> expect_offense(<<~RUBY) <add> class Foo < Formula <add> homepage "http://example.com" <add> url "http://example.com/foo-1.0.tgz" <add> depends_on "foo" <add> depends_on "bar" <add> ^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "foo" (line 4) <add> end <add> RUBY <add> end <add> <add> it "wrong conditional depends_on order" do <add> expect_offense(<<~RUBY) <add> class Foo < Formula <add> homepage "http://example.com" <add> url "http://example.com/foo-1.0.tgz" <add> head do <add> depends_on "apple" if build.with? "foo" <add> depends_on "bar" <add> ^^^^^^^^^^^^^^^^ dependency "bar" (line 6) should be put before dependency "apple" (line 5) <add> depends_on "foo" => :optional <add> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 7) should be put before dependency "apple" (line 5) <add> end <add> depends_on "apple" if build.with? "foo" <add> depends_on "foo" => :optional <add> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 10) should be put before dependency "apple" (line 9) <add> end <add> RUBY <add> end <add> end <add> <add> context "autocorrect" do <add> it "wrong conditional depends_on order" do <add> source = <<~EOS <add> class Foo < Formula <add> homepage "http://example.com" <add> url "http://example.com/foo-1.0.tgz" <add> depends_on "apple" if build.with? "foo" <add> depends_on "foo" => :optional <add> end <add> EOS <add> <add> correct_source = <<~EOS <add> class Foo < Formula <add> homepage "http://example.com" <add> url "http://example.com/foo-1.0.tgz" <add> depends_on "foo" => :optional <add> depends_on "apple" if build.with? "foo" <add> end <add> EOS <add> <add> corrected_source = autocorrect_source(source) <add> expect(corrected_source).to eq(correct_source) <add> end <add> end <add>end
3
Python
Python
make savetxt work with file like objects
b82c1df6f99c62a120dfd9d5c606110d593d96e7
<ide><path>numpy/lib/npyio.py <ide> def savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='\n', header='', <ide> fh = open(fname, 'wb') <ide> else: <ide> fh = open(fname, 'w') <del> elif hasattr(fname, 'seek'): <add> elif hasattr(fname, 'write'): <ide> fh = fname <ide> else: <ide> raise ValueError('fname must be a string or file handle')
1
Text
Text
add new discussion links to performance
f4c908b4e0b47a090fb4036e1f12fc1729fd1bb5
<ide><path>docs/faq/Performance.md <ide> ## Performance <ide> <ide> <a id="performance-scaling"></a> <del>### How well does Redux “scale” in terms of performance and architecture? <add>### How well does Redux “scale” in terms of performance and architecture? <ide> <ide> While there's no single definitive answer to this, most of the time this should not be a concern in either case. <ide> <ide> Redux does not store a history of actions itself. However, the Redux DevTools do <ide> <ide> **Discussions** <ide> - [Stack Overflow: Is there any way to "commit" the state in Redux to free memory?](http://stackoverflow.com/questions/35627553/is-there-any-way-to-commit-the-state-in-redux-to-free-memory/35634004) <add>- [Stack Overflow: Can a Redux store lead to a memory leak?](https://stackoverflow.com/questions/39943762/can-a-redux-store-lead-to-a-memory-leak/40549594#40549594) <add>- [Stack Overflow: Redux and ALL the application state](https://stackoverflow.com/questions/42489557/redux-and-all-the-application-state/42491766#42491766) <add>- [Stack Overflow: Memory Usage Concern with Controlled Components](https://stackoverflow.com/questions/44956071/memory-usage-concern-with-controlled-components?noredirect=1&lq=1) <ide> - [Reddit: What's the best place to keep initial state?](https://www.reddit.com/r/reactjs/comments/47m9h5/whats_the_best_place_to_keep_the_initial_state/)
1
Mixed
Python
allow custom keyword in the header
ffdac0d93619b7ec6039b94ce0e563f0330faeb1
<ide><path>docs/api-guide/authentication.md <ide> For clients to authenticate, the token key should be included in the `Authorizat <ide> <ide> Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b <ide> <add>**Note:** If you want to use a different keyword in the header, such as `Bearer`, simply subclass `TokenAuthentication` and set the `keyword` class variable. <add> <ide> If successfully authenticated, `TokenAuthentication` provides the following credentials. <ide> <ide> * `request.user` will be a Django `User` instance. <ide><path>rest_framework/authentication.py <ide> class TokenAuthentication(BaseAuthentication): <ide> Authorization: Token 401f7ac837da42b97f613d789819ff93537bee6a <ide> """ <ide> <add> keyword = 'Token' <ide> model = None <ide> <ide> def get_model(self): <ide> def get_model(self): <ide> def authenticate(self, request): <ide> auth = get_authorization_header(request).split() <ide> <del> if not auth or auth[0].lower() != b'token': <add> if not auth or auth[0].lower() != self.keyword.lower().encode(): <ide> return None <ide> <ide> if len(auth) == 1: <ide> def authenticate_credentials(self, key): <ide> return (token.user, token) <ide> <ide> def authenticate_header(self, request): <del> return 'Token' <add> return self.keyword <ide><path>tests/test_authentication.py <ide> class CustomTokenAuthentication(TokenAuthentication): <ide> model = CustomToken <ide> <ide> <add>class CustomKeywordTokenAuthentication(TokenAuthentication): <add> keyword = 'Bearer' <add> <add> <ide> class MockView(APIView): <ide> permission_classes = (permissions.IsAuthenticated,) <ide> <ide> def put(self, request): <ide> url(r'^basic/$', MockView.as_view(authentication_classes=[BasicAuthentication])), <ide> url(r'^token/$', MockView.as_view(authentication_classes=[TokenAuthentication])), <ide> url(r'^customtoken/$', MockView.as_view(authentication_classes=[CustomTokenAuthentication])), <add> url(r'^customkeywordtoken/$', MockView.as_view(authentication_classes=[CustomKeywordTokenAuthentication])), <ide> url(r'^auth-token/$', 'rest_framework.authtoken.views.obtain_auth_token'), <ide> url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')), <ide> ] <ide> class BaseTokenAuthTests(object): <ide> urls = 'tests.test_authentication' <ide> model = None <ide> path = None <add> header_prefix = 'Token ' <ide> <ide> def setUp(self): <ide> self.csrf_client = APIClient(enforce_csrf_checks=True) <ide> def setUp(self): <ide> <ide> def test_post_form_passing_token_auth(self): <ide> """Ensure POSTing json over token auth with correct credentials passes and does not require CSRF""" <del> auth = 'Token ' + self.key <add> auth = self.header_prefix + self.key <ide> response = self.csrf_client.post(self.path, {'example': 'example'}, HTTP_AUTHORIZATION=auth) <ide> self.assertEqual(response.status_code, status.HTTP_200_OK) <ide> <ide> def test_fail_post_form_passing_nonexistent_token_auth(self): <ide> # use a nonexistent token key <del> auth = 'Token wxyz6789' <add> auth = self.header_prefix + 'wxyz6789' <ide> response = self.csrf_client.post(self.path, {'example': 'example'}, HTTP_AUTHORIZATION=auth) <ide> self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) <ide> <ide> def test_fail_post_form_passing_invalid_token_auth(self): <ide> # add an 'invalid' unicode character <del> auth = 'Token ' + self.key + "¸" <add> auth = self.header_prefix + self.key + "¸" <ide> response = self.csrf_client.post(self.path, {'example': 'example'}, HTTP_AUTHORIZATION=auth) <ide> self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) <ide> <ide> def test_post_json_passing_token_auth(self): <ide> """Ensure POSTing form over token auth with correct credentials passes and does not require CSRF""" <del> auth = "Token " + self.key <add> auth = self.header_prefix + self.key <ide> response = self.csrf_client.post(self.path, {'example': 'example'}, format='json', HTTP_AUTHORIZATION=auth) <ide> self.assertEqual(response.status_code, status.HTTP_200_OK) <ide> <ide> def test_post_json_makes_one_db_query(self): <ide> """Ensure that authenticating a user using a token performs only one DB query""" <del> auth = "Token " + self.key <add> auth = self.header_prefix + self.key <ide> <ide> def func_to_test(): <ide> return self.csrf_client.post(self.path, {'example': 'example'}, format='json', HTTP_AUTHORIZATION=auth) <ide> class CustomTokenAuthTests(BaseTokenAuthTests, TestCase): <ide> path = '/customtoken/' <ide> <ide> <add>class CustomKeywordTokenAuthTests(BaseTokenAuthTests, TestCase): <add> model = Token <add> path = '/customkeywordtoken/' <add> header_prefix = 'Bearer ' <add> <add> <ide> class IncorrectCredentialsTests(TestCase): <ide> def test_incorrect_credentials(self): <ide> """
3
Go
Go
restore anonymus import in iptables_test.go
1589c43f9d0f61fc3fe4fdbb01244688bda80640
<ide><path>libnetwork/iptables/iptables_test.go <ide> import ( <ide> "strings" <ide> "sync" <ide> "testing" <add> <add> _ "github.com/docker/libnetwork/netutils" <ide> ) <ide> <ide> const chainName = "DOCKER-TEST"
1
Mixed
Python
add distribution strategy to keras benchmark
28863de1c832a27fa8c7d229c48b05207870be81
<ide><path>official/keras_application_models/README.md <ide> Synthetic dataset is used for the benchmark. <ide> Two custom callbacks are provided for model benchmarking: ExamplesPerSecondCallback and LoggingMetricCallback. For each callback, `epoch_based` and `batch_based` options are available to set the benchmark level. Check [model_callbacks.py](model_callbacks.py) for more details. <ide> <ide> ## Running Code <del>To benchmark a model, use `--model` to specify the model name, and issue the following command: <add>To benchmark a model, use `--model` to specify the model name. To perform the benchmark with eager execution, issue the following command: <ide> ``` <del>python benchmark_main.py --model=resnet <add>python benchmark_main.py --model resnet50 --eager <ide> ``` <add>Note that, if eager execution is enabled, only one GPU is utilized even if multiple GPUs are provided and multi_gpu_model is used. <add> <add> <add>To use distribution strategy in the benchmark, run the following: <add>``` <add>python benchmark_main.py --model resnet50 --dist_strat <add>``` <add>Currently, only one of the --eager and --dist_strat arguments can be defined, as DistributionStrategy is not supported in Eager execution now. <add> <ide> Arguments: <ide> * `--model`: Which model to be benchmarked. The model name is defined as the keys of `MODELS` in [benchmark_main.py](benchmark_main.py). <ide> * `--callbacks`: To specify a list of callbacks. <ide><path>official/keras_application_models/benchmark_main.py <ide> from official.keras_application_models import model_callbacks <ide> from official.utils.flags import core as flags_core <ide> from official.utils.logs import logger <add>from official.utils.misc import distribution_utils <ide> <ide> # Define a dictionary that maps model names to their model classes inside Keras <ide> MODELS = { <ide> "densenet121": tf.keras.applications.DenseNet121, <ide> "densenet169": tf.keras.applications.DenseNet169, <ide> "densenet201": tf.keras.applications.DenseNet201, <del> # TODO(b/80431378) <del> # "nasnetlarge": tf.keras.applications.NASNetLarge, <del> # "nasnetmobile": tf.keras.applications.NASNetMobile, <add> "nasnetlarge": tf.keras.applications.NASNetLarge, <add> "nasnetmobile": tf.keras.applications.NASNetMobile, <ide> } <ide> <ide> <ide> def run_keras_model_benchmark(_): <ide> else: <ide> raise ValueError("Only synthetic dataset is supported!") <ide> <del> # If run with multiple GPUs <del> # If eager execution is enabled, only one GPU is utilized even if multiple <del> # GPUs are provided. <ide> num_gpus = flags_core.get_num_gpus(FLAGS) <del> if num_gpus > 1: <add> <add> distribution = None <add> # Use distribution strategy <add> if FLAGS.dist_strat: <add> distribution = distribution_utils.get_distribution_strategy( <add> num_gpus=num_gpus) <add> elif num_gpus > 1: <add> # Run with multi_gpu_model <add> # If eager execution is enabled, only one GPU is utilized even if multiple <add> # GPUs are provided. <ide> if FLAGS.eager: <ide> tf.logging.warning( <ide> "{} GPUs are provided, but only one GPU is utilized as " <ide> "eager execution is enabled.".format(num_gpus)) <ide> model = tf.keras.utils.multi_gpu_model(model, gpus=num_gpus) <ide> <add> # Adam optimizer and some other optimizers doesn't work well with <add> # distribution strategy (b/113076709) <add> # Use GradientDescentOptimizer here <add> optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.001) <ide> model.compile(loss="categorical_crossentropy", <del> optimizer=tf.train.AdamOptimizer(), <del> metrics=["accuracy"]) <add> optimizer=optimizer, <add> metrics=["accuracy"], <add> distribute=distribution) <ide> <ide> # Create benchmark logger for benchmark logging <ide> run_params = { <ide> "batch_size": FLAGS.batch_size, <ide> "synthetic_data": FLAGS.use_synthetic_data, <ide> "train_epochs": FLAGS.train_epochs, <del> "num_train_images": FLAGS.num_images, <del> "num_eval_images": FLAGS.num_images, <add> "num_train_images": FLAGS.num_train_images, <add> "num_eval_images": FLAGS.num_eval_images, <ide> } <ide> <ide> benchmark_logger = logger.get_benchmark_logger() <ide> def run_keras_model_benchmark(_): <ide> epochs=FLAGS.train_epochs, <ide> callbacks=callbacks, <ide> validation_data=val_dataset, <del> steps_per_epoch=int(np.ceil(FLAGS.num_images / FLAGS.batch_size)), <del> validation_steps=int(np.ceil(FLAGS.num_images / FLAGS.batch_size)) <add> steps_per_epoch=int(np.ceil(FLAGS.num_train_images / FLAGS.batch_size)), <add> validation_steps=int(np.ceil(FLAGS.num_eval_images / FLAGS.batch_size)) <ide> ) <ide> <ide> tf.logging.info("Logging the evaluation results...") <ide> def run_keras_model_benchmark(_): <ide> "accuracy": history.history["val_acc"][epoch], <ide> "loss": history.history["val_loss"][epoch], <ide> tf.GraphKeys.GLOBAL_STEP: (epoch + 1) * np.ceil( <del> FLAGS.num_images/FLAGS.batch_size) <add> FLAGS.num_eval_images/FLAGS.batch_size) <ide> } <ide> benchmark_logger.log_evaluation_result(eval_results) <ide> <ide> def define_keras_benchmark_flags(): <ide> "Model to be benchmarked.")) <ide> <ide> flags.DEFINE_integer( <del> name="num_images", default=1000, <add> name="num_train_images", default=1000, <add> help=flags_core.help_wrap( <add> "The number of synthetic images for training. The default value is " <add> "1000.")) <add> <add> flags.DEFINE_integer( <add> name="num_eval_images", default=50, <ide> help=flags_core.help_wrap( <del> "The number of synthetic images for training and evaluation. The " <del> "default value is 1000.")) <add> "The number of synthetic images for evaluation. The default value is " <add> "50.")) <ide> <ide> flags.DEFINE_boolean( <ide> name="eager", default=False, help=flags_core.help_wrap( <ide> "To enable eager execution. Note that if eager execution is enabled, " <ide> "only one GPU is utilized even if multiple GPUs are provided and " <ide> "multi_gpu_model is used.")) <ide> <add> flags.DEFINE_boolean( <add> name="dist_strat", default=False, help=flags_core.help_wrap( <add> "To enable distribution strategy for model training and evaluation. " <add> "Number of GPUs used for distribution strategy can be set by the " <add> "argument --num_gpus.")) <add> <ide> flags.DEFINE_list( <ide> name="callbacks", <ide> default=["ExamplesPerSecondCallback", "LoggingMetricCallback"], <ide> def define_keras_benchmark_flags(): <ide> "callbacks. For example: `--callbacks ExamplesPerSecondCallback," <ide> "LoggingMetricCallback`")) <ide> <add> @flags.multi_flags_validator( <add> ["eager", "dist_strat"], <add> message="Both --eager and --dist_strat were set. Only one can be " <add> "defined, as DistributionStrategy is not supported in Eager " <add> "execution currently.") <add> # pylint: disable=unused-variable <add> def _check_eager_dist_strat(flag_dict): <add> return not(flag_dict["eager"] and flag_dict["dist_strat"]) <add> <ide> <ide> def main(_): <ide> with logger.benchmark_context(FLAGS):
2
Text
Text
adjust translation to spread-syntax on portuguese
9c6cbc5732800bd271bccae468230516724da933
<ide><path>guide/portuguese/javascript/spread-syntax/index.md <ide> title: Spread syntax <ide> localeTitle: Espalhe a sintaxe <ide> --- <del>## Espalhe a sintaxe <add>## Operador Spread <ide> <del>A sintaxe de propagação permite que uma iterável, como uma expressão de matriz ou cadeia, seja expandida em locais onde zero ou mais argumentos (para chamadas de função) ou elementos (para literais de matriz) sejam esperados ou uma expressão de objeto seja expandida em locais onde zero é esperado . <add>O conceito de spread é permitir que um iterável, como um array ou string seja expandida em locais onde zero ou mais argumentos (para chamadas de função) ou elementos (para arrays) sejam esperados ou uma expressão de objeto seja expandida em locais onde zero é esperado. <ide> <ide> ### Sintaxe <ide> <ide> Para literais ou strings de array: <ide> <ide> ### Exemplos <ide> <del>#### Espalhe em chamadas de função <add>#### Spread em chamadas de função <ide> <ide> #### Substituir aplicar <ide> <ide> É comum usar o `Function.prototype.apply` nos casos em que você deseja usar os elementos de um array como argumentos para uma função. <del>``` <add>```js <ide> function myFunction(x, y, z) { } <ide> var args = [0, 1, 2]; <ide> myFunction.apply(null, args); <ide> ``` <ide> <del>Com a sintaxe de propagação, o acima pode ser escrito como: <del>``` <add>Com a operador spread, o exemplo acima pode ser escrito como: <add>```js <ide> function myFunction(x, y, z) { } <ide> var args = [0, 1, 2]; <ide> myFunction(...args); <ide> ``` <ide> <del>Qualquer argumento na lista de argumentos pode usar a sintaxe de propagação e pode ser usado várias vezes. <del>``` <add>Qualquer argumento na lista de argumentos pode usar a operador spread e pode ser usado várias vezes. <add>```js <ide> function myFunction(v, w, x, y, z) { } <ide> var args = [0, 1]; <ide> myFunction(-1, ...args, 2, ...[3]); <ide> ``` <ide> <del>### Inscreva-se para novos <add>### Apply e New <ide> <del>Ao chamar um construtor com `new` , não é possível usar **diretamente** um array e `apply` ( `apply` faz um `[[Call]]` e não um `[[Construct]]` ). No entanto, um array pode ser facilmente usado com novos agradecimentos à sintaxe de propagação: <del>``` <add>Ao chamar um construtor com `new` , não é possível usar **diretamente** um array e `apply` ( `apply` faz um `[[Call]]` e não um `[[Construct]]` ). No entanto, um array pode ser facilmente usado com `new` graças à operador spread: <add>```js <ide> var dateFields = [1970, 0, 1]; // 1 Jan 1970 <ide> var d = new Date(...dateFields); <ide> ``` <ide> <del>Para usar o novo com uma matriz de parâmetros sem sintaxe de propagação, você teria que fazê-lo **indiretamente** através da aplicação parcial: <del>``` <add>Para usar `new` com um array de parâmetros sem operador spread, você teria que fazê-lo **indiretamente** através da aplicação parcial: <add>```js <ide> function applyAndNew(constructor, args) { <ide> function partial () { <ide> return constructor.apply(this, args); <ide> function applyAndNew(constructor, args) { <ide> // (log of "new myConstructorWithArguments"): {prop1: "val1", prop2: "val2"} <ide> ``` <ide> <del>### Espalhar em literais de array <add>### Spread em literais de array <ide> <ide> #### Um literal de array mais poderoso <ide> <del>Sem a sintaxe de propagação, para criar uma nova matriz usando uma matriz existente como uma parte dela, a sintaxe literal da matriz não é mais suficiente e um código imperativo deve ser usado usando uma combinação de push, splice, concat, etc. torna-se muito mais sucinto: <del>``` <add>Sem a sintaxe de propagação, para criar um novo array usando um array existente como uma parte dela, a sintaxe literal de array não é mais suficiente e um código imperativo deve ser usado ao invez de uma combinação de push, splice, concat, etc. torna-se muito mais sucinto: <add>```js <ide> var parts = ['shoulders', 'knees']; <ide> var lyrics = ['head', ...parts, 'and', 'toes']; <ide> // ["head", "shoulders", "knees", "and", "toes"] <ide> ``` <ide> <del>Assim como o spread para listas de argumentos, `...` pode ser usado em qualquer lugar no literal da matriz e pode ser usado várias vezes. <add>Assim como o spread para listas de argumentos, `...` pode ser usado em qualquer lugar em um array e pode ser usado várias vezes. <ide> <del>### Copie uma matriz <del>``` <add>### Copie um array <add>```js <ide> var arr = [1, 2, 3]; <ide> var arr2 = [...arr]; // like arr.slice() <ide> arr2.push(4); <ide> var arr = [1, 2, 3]; <ide> // arr remains unaffected <ide> ``` <ide> <del>> **Nota** : A sintaxe de propagação atinge um nível de profundidade enquanto copia uma matriz. Portanto, pode ser inadequado para copiar matrizes multidimensionais como mostra o exemplo a seguir (é o mesmo com Object.assign () e sintaxe de propagação). <del>``` <add>> **Nota** : A operador spread atinge um nível de profundidade enquanto copia um array. Portanto, pode ser inadequado para copiar arrays multidimensionais como mostra o exemplo a seguir (é o mesmo com Object.assign () e operador spread). <add>```js <ide> var a = [[1], [2], [3]]; <ide> var b = [...a]; <ide> b.shift().shift(); // 1 <ide> // Now array a is affected as well: [[], [2], [3]] <ide> ``` <ide> <del>### Uma maneira melhor de concatenar matrizes <add>### Uma maneira melhor de concatenar arrays <ide> <del>`Array.concat` é freqüentemente usado para concatenar uma matriz ao final de uma matriz existente. Sem a sintaxe de propagação, isso é feito como: <del>``` <add>`Array.concat` é freqüentemente usado para concatenar um array ao final de um array existente. Sem a operador spread, isso é feito como: <add>```js <ide> var arr1 = [0, 1, 2]; <ide> var arr2 = [3, 4, 5]; <ide> // Append all items from arr2 onto arr1 <ide> arr1 = arr1.concat(arr2); <ide> ``` <ide> <del>Com a sintaxe de propagação, isso se torna: <del>``` <add>Com a operador spread, isso se torna: <add>```js <ide> var arr1 = [0, 1, 2]; <del> var arr2 = [3, 4, 5]; <del> arr1 = [...arr1, ...arr2]; <add>var arr2 = [3, 4, 5]; <add>arr1 = [...arr1, ...arr2]; <ide> ``` <ide> <del>`Array.unshift` é frequentemente usado para inserir uma matriz de valores no início de um array existente. Sem a sintaxe de propagação, isso é feito como: <del>``` <add>`Array.unshift` é frequentemente usado para inserir um array de valores no início de um array existente. Sem a operador spread, isso é feito como: <add>```js <ide> var arr1 = [0, 1, 2]; <del> var arr2 = [3, 4, 5]; <del> // Prepend all items from arr2 onto arr1 <del> Array.prototype.unshift.apply(arr1, arr2) // arr1 is now [3, 4, 5, 0, 1, 2] <add>var arr2 = [3, 4, 5]; <add>// Prepend all items from arr2 onto arr1 <add>Array.prototype.unshift.apply(arr1, arr2) // arr1 is now [3, 4, 5, 0, 1, 2] <ide> ``` <ide> <del>Com a sintaxe de propagação, isso se torna: <del>``` <add>Com a operador spread, isso se torna: <add>```js <ide> var arr1 = [0, 1, 2]; <del> var arr2 = [3, 4, 5]; <del> arr1 = [...arr2, ...arr1]; // arr1 is now [3, 4, 5, 0, 1, 2] <del> <del>``` <ide>\ No newline at end of file <add>var arr2 = [3, 4, 5]; <add>arr1 = [...arr2, ...arr1]; // arr1 is now [3, 4, 5, 0, 1, 2] <add>```
1
Javascript
Javascript
add mem caching for getblockmodules
283359261db1d83e8918fd950185075f0c5847fa
<ide><path>lib/buildChunkGraph.js <ide> const visitModules = ( <ide> blocksWithNestedBlocks, <ide> allCreatedChunkGroups <ide> ) => { <del> const { moduleGraph, chunkGraph } = compilation; <add> const { moduleGraph, chunkGraph, moduleMemCaches } = compilation; <ide> <ide> const blockModulesRuntimeMap = new Map(); <ide> <ide> const visitModules = ( <ide> let blockModules = blockModulesMap.get(block); <ide> if (blockModules !== undefined) return blockModules; <ide> logger.time("visitModules: prepare"); <del> extractBlockModules( <del> block.getRootBlock(), <del> moduleGraph, <del> runtime, <del> blockModulesMap <del> ); <add> const module = /** @type {Module} */ (block.getRootBlock()); <add> const memCache = moduleMemCaches && moduleMemCaches.get(module); <add> if (memCache !== undefined) { <add> const map = memCache.provide( <add> "bundleChunkGraph.blockModules", <add> runtime, <add> () => { <add> const map = new Map(); <add> extractBlockModules(module, moduleGraph, runtime, map); <add> return map; <add> } <add> ); <add> for (const [block, blockModules] of map) <add> blockModulesMap.set(block, blockModules); <add> } else { <add> extractBlockModules(module, moduleGraph, runtime, blockModulesMap); <add> } <ide> logger.timeAggregate("visitModules: prepare"); <ide> blockModules = blockModulesMap.get(block); <ide> if (blockModules === undefined) {
1
Mixed
Go
add os to docker info
b0fb0055d279bc25aa2f91c112929ea8eb92c1db
<ide><path>api/client/commands.go <ide> func (cli *DockerCli) CmdInfo(args ...string) error { <ide> } <ide> fmt.Fprintf(cli.out, "Execution Driver: %s\n", remoteInfo.Get("ExecutionDriver")) <ide> fmt.Fprintf(cli.out, "Kernel Version: %s\n", remoteInfo.Get("KernelVersion")) <add> fmt.Fprintf(cli.out, "Operating System: %s\n", remoteInfo.Get("OperatingSystem")) <ide> <ide> if remoteInfo.GetBool("Debug") || os.Getenv("DEBUG") != "" { <ide> fmt.Fprintf(cli.out, "Debug mode (server): %v\n", remoteInfo.GetBool("Debug")) <ide><path>docs/man/docker-info.1.md <ide> There are no available options. <ide> Here is a sample output: <ide> <ide> # docker info <del> Containers: 18 <del> Images: 95 <del> Storage Driver: devicemapper <del> Pool Name: docker-8:1-170408448-pool <del> Data file: /var/lib/docker/devicemapper/devicemapper/data <del> Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata <del> Data Space Used: 9946.3 Mb <del> Data Space Total: 102400.0 Mb <del> Metadata Space Used: 9.9 Mb <del> Metadata Space Total: 2048.0 Mb <del> Execution Driver: native-0.1 <del> Kernel Version: 3.10.0-116.el7.x86_64 <add> Containers: 14 <add> Images: 52 <add> Storage Driver: aufs <add> Root Dir: /var/lib/docker/aufs <add> Dirs: 80 <add> Execution Driver: native-0.2 <add> Kernel Version: 3.13.0-24-generic <add> Operating System: Ubuntu 14.04 LTS <ide> <ide> # HISTORY <ide> April 2014, Originally compiled by William Henry (whenry at redhat dot com) <ide><path>docs/sources/reference/commandline/cli.md <ide> tar, then the ownerships might not get preserved. <ide> For example: <ide> <ide> $ sudo docker -D info <del> Containers: 16 <del> Images: 2138 <add> Containers: 14 <add> Images: 52 <ide> Storage Driver: btrfs <del> Execution Driver: native-0.1 <del> Kernel Version: 3.12.0-1-amd64 <add> Execution Driver: native-0.2 <add> Kernel Version: 3.13.0-24-generic <add> Operating System: Ubuntu 14.04 LTS <ide> Debug mode (server): false <ide> Debug mode (client): true <del> Fds: 16 <del> Goroutines: 104 <add> Fds: 10 <add> Goroutines: 9 <ide> EventsListeners: 0 <ide> Init Path: /usr/bin/docker <del> Sockets: [unix:///var/run/docker.sock tcp://0.0.0.0:4243] <add> Sockets: [unix:///var/run/docker.sock] <ide> Username: svendowideit <ide> Registry: [https://index.docker.io/v1/] <ide> <ide><path>pkg/parsers/operatingsystem/operatingsystem.go <add>package operatingsystem <add> <add>import ( <add> "bytes" <add> "errors" <add> "io/ioutil" <add>) <add> <add>var ( <add> // file to use to detect if the daemon is running in a container <add> proc1Cgroup = "/proc/1/cgroup" <add> <add> // file to check to determine Operating System <add> etcOsRelease = "/etc/os-release" <add>) <add> <add>func GetOperatingSystem() (string, error) { <add> b, err := ioutil.ReadFile(etcOsRelease) <add> if err != nil { <add> return "", err <add> } <add> if i := bytes.Index(b, []byte("PRETTY_NAME")); i >= 0 { <add> b = b[i+13:] <add> return string(b[:bytes.IndexByte(b, '"')]), nil <add> } <add> return "", errors.New("PRETTY_NAME not found") <add>} <add> <add>func IsContainerized() (bool, error) { <add> b, err := ioutil.ReadFile(proc1Cgroup) <add> if err != nil { <add> return false, err <add> } <add> for _, line := range bytes.Split(b, []byte{'\n'}) { <add> if len(line) > 0 && !bytes.HasSuffix(line, []byte{'/'}) { <add> return true, nil <add> } <add> } <add> return false, nil <add>} <ide><path>pkg/parsers/operatingsystem/operatingsystem_test.go <add>package operatingsystem <add> <add>import ( <add> "io/ioutil" <add> "os" <add> "path/filepath" <add> "testing" <add>) <add> <add>func TestGetOperatingSystem(t *testing.T) { <add> var ( <add> backup = etcOsRelease <add> ubuntuTrusty = []byte(`NAME="Ubuntu" <add>VERSION="14.04, Trusty Tahr" <add>ID=ubuntu <add>ID_LIKE=debian <add>PRETTY_NAME="Ubuntu 14.04 LTS" <add>VERSION_ID="14.04" <add>HOME_URL="http://www.ubuntu.com/" <add>SUPPORT_URL="http://help.ubuntu.com/" <add>BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"`) <add> gentoo = []byte(`NAME=Gentoo <add>ID=gentoo <add>PRETTY_NAME="Gentoo/Linux" <add>ANSI_COLOR="1;32" <add>HOME_URL="http://www.gentoo.org/" <add>SUPPORT_URL="http://www.gentoo.org/main/en/support.xml" <add>BUG_REPORT_URL="https://bugs.gentoo.org/" <add>`) <add> noPrettyName = []byte(`NAME="Ubuntu" <add>VERSION="14.04, Trusty Tahr" <add>ID=ubuntu <add>ID_LIKE=debian <add>VERSION_ID="14.04" <add>HOME_URL="http://www.ubuntu.com/" <add>SUPPORT_URL="http://help.ubuntu.com/" <add>BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"`) <add> ) <add> <add> dir := os.TempDir() <add> defer func() { <add> etcOsRelease = backup <add> os.RemoveAll(dir) <add> }() <add> <add> etcOsRelease = filepath.Join(dir, "etcOsRelease") <add> for expect, osRelease := range map[string][]byte{ <add> "Ubuntu 14.04 LTS": ubuntuTrusty, <add> "Gentoo/Linux": gentoo, <add> "": noPrettyName, <add> } { <add> if err := ioutil.WriteFile(etcOsRelease, osRelease, 0600); err != nil { <add> t.Fatalf("failed to write to %s: %v", etcOsRelease, err) <add> } <add> s, err := GetOperatingSystem() <add> if s != expect { <add> if expect == "" { <add> t.Fatalf("Expected error 'PRETTY_NAME not found', but got %v", err) <add> } else { <add> t.Fatalf("Expected '%s', but got '%s'. Err=%v", expect, s, err) <add> } <add> } <add> } <add>} <add> <add>func TestIsContainerized(t *testing.T) { <add> var ( <add> backup = proc1Cgroup <add> nonContainerizedProc1Cgroup = []byte(`14:name=systemd:/ <add>13:hugetlb:/ <add>12:net_prio:/ <add>11:perf_event:/ <add>10:bfqio:/ <add>9:blkio:/ <add>8:net_cls:/ <add>7:freezer:/ <add>6:devices:/ <add>5:memory:/ <add>4:cpuacct:/ <add>3:cpu:/ <add>2:cpuset:/ <add>`) <add> containerizedProc1Cgroup = []byte(`9:perf_event:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d <add>8:blkio:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d <add>7:net_cls:/ <add>6:freezer:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d <add>5:devices:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d <add>4:memory:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d <add>3:cpuacct:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d <add>2:cpu:/docker/3cef1b53c50b0fa357d994f8a1a8cd783c76bbf4f5dd08b226e38a8bd331338d <add>1:cpuset:/`) <add> ) <add> <add> dir := os.TempDir() <add> defer func() { <add> proc1Cgroup = backup <add> os.RemoveAll(dir) <add> }() <add> <add> proc1Cgroup = filepath.Join(dir, "proc1Cgroup") <add> <add> if err := ioutil.WriteFile(proc1Cgroup, nonContainerizedProc1Cgroup, 0600); err != nil { <add> t.Fatalf("failed to write to %s: %v", proc1Cgroup, err) <add> } <add> inContainer, err := IsContainerized() <add> if err != nil { <add> t.Fatal(err) <add> } <add> if inContainer { <add> t.Fatal("Wrongly assuming containerized") <add> } <add> <add> if err := ioutil.WriteFile(proc1Cgroup, containerizedProc1Cgroup, 0600); err != nil { <add> t.Fatalf("failed to write to %s: %v", proc1Cgroup, err) <add> } <add> inContainer, err = IsContainerized() <add> if err != nil { <add> t.Fatal(err) <add> } <add> if !inContainer { <add> t.Fatal("Wrongly assuming non-containerized") <add> } <add>} <ide><path>server/server.go <ide> import ( <ide> "github.com/docker/docker/pkg/parsers" <ide> "github.com/docker/docker/pkg/parsers/filters" <ide> "github.com/docker/docker/pkg/parsers/kernel" <add> "github.com/docker/docker/pkg/parsers/operatingsystem" <ide> "github.com/docker/docker/pkg/signal" <ide> "github.com/docker/docker/pkg/tailfile" <ide> "github.com/docker/docker/registry" <ide> func (srv *Server) DockerInfo(job *engine.Job) engine.Status { <ide> kernelVersion = kv.String() <ide> } <ide> <add> operatingSystem := "<unknown>" <add> if s, err := operatingsystem.GetOperatingSystem(); err == nil { <add> operatingSystem = s <add> } <add> if inContainer, err := operatingsystem.IsContainerized(); err != nil { <add> utils.Errorf("Could not determine if daemon is containerized: %v", err) <add> operatingSystem += " (error determining if containerized)" <add> } else if inContainer { <add> operatingSystem += " (containerized)" <add> } <add> <ide> // if we still have the original dockerinit binary from before we copied it locally, let's return the path to that, since that's more intuitive (the copied path is trivial to derive by hand given VERSION) <ide> initPath := utils.DockerInitPath("") <ide> if initPath == "" { <ide> func (srv *Server) DockerInfo(job *engine.Job) engine.Status { <ide> v.Set("ExecutionDriver", srv.daemon.ExecutionDriver().Name()) <ide> v.SetInt("NEventsListener", srv.eventPublisher.SubscribersCount()) <ide> v.Set("KernelVersion", kernelVersion) <add> v.Set("OperatingSystem", operatingSystem) <ide> v.Set("IndexServerAddress", registry.IndexServerAddress()) <ide> v.Set("InitSha1", dockerversion.INITSHA1) <ide> v.Set("InitPath", initPath)
6
Text
Text
add timothygu to collaborators
09ebdf14005cc948529b3f193ad550d5dfded26a
<ide><path>README.md <ide> more information about the governance of the Node.js project, see <ide> **Glen Keane** &lt;[email protected]&gt; <ide> * [thlorenz](https://github.com/thlorenz) - <ide> **Thorsten Lorenz** &lt;[email protected]&gt; <add>* [TimothyGu](https://github.com/TimothyGu) - <add>**Timothy Gu** &lt;[email protected]&gt; <ide> * [tunniclm](https://github.com/tunniclm) - <ide> **Mike Tunnicliffe** &lt;[email protected]&gt; <ide> * [vkurchatkin](https://github.com/vkurchatkin) -
1
Python
Python
remove duplicate code
41d89b7f761b2b2246d896b1e709f1fb3df28116
<ide><path>numpy/linalg/linalg.py <ide> def _linalgRealType(t): <ide> """Cast the type t to either double or cdouble.""" <ide> return double <ide> <del>_complex_types_map = {single : csingle, <del> double : cdouble, <del> csingle : csingle, <del> cdouble : cdouble} <del> <ide> def _commonType(*arrays): <ide> # in lite version, use higher precision (always double or cdouble) <ide> result_type = single
1
Ruby
Ruby
restore private remote test
9810c2a412526346797f2f1ef60ddbccddeca2cb
<ide><path>Library/Homebrew/test/test_tap.rb <ide> def setup <ide> @path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo" <ide> @path.mkpath <ide> @tap = Tap.new("Homebrew", "foo") <del> @tap.stubs(:private?).returns(true) if ENV["HOMEBREW_NO_GITHUB_API"] <ide> end <ide> <ide> def setup_tap_files <ide> def test_remote <ide> refute_predicate version_tap, :private? <ide> end <ide> <add> def test_private_remote <add> skip "HOMEBREW_GITHUB_API_TOKEN is required" unless ENV["HOMEBREW_GITHUB_API_TOKEN"] <add> assert_predicate @tap, :private? <add> end <add> <ide> def test_install_tap_already_tapped_error <ide> assert_raises(TapAlreadyTappedError) { @tap.install } <ide> end
1
Ruby
Ruby
fix gh . allow swapping middleware of same class
e7ec96989543b95d3459fcdab1f31466ec179233
<ide><path>actionpack/lib/action_dispatch/middleware/stack.rb <ide> def insert_after(index, *args, &block) <ide> end <ide> <ide> def swap(target, *args, &block) <del> insert_before(target, *args, &block) <del> delete(target) <add> index = assert_index(target, :before) <add> insert(index, *args, &block) <add> middlewares.delete_at(index + 1) <ide> end <ide> <ide> def delete(target) <ide><path>actionpack/test/dispatch/middleware_stack_test.rb <ide> def setup <ide> assert_equal BazMiddleware, @stack[0].klass <ide> end <ide> <add> test "swaps one middleware out for same middleware class" do <add> assert_equal FooMiddleware, @stack[0].klass <add> @stack.swap(FooMiddleware, FooMiddleware, Proc.new { |env| [500, {}, ['error!']] }) <add> assert_equal FooMiddleware, @stack[0].klass <add> end <add> <ide> test "raise an error on invalid index" do <ide> assert_raise RuntimeError do <ide> @stack.insert("HiyaMiddleware", BazMiddleware)
2
Go
Go
fix shouldrestart for on-failure handle
51e42e6ee01eb4b5c8c7678e2fc7be0f13ef6a68
<ide><path>container/container.go <ide> func copyEscapable(dst io.Writer, src io.ReadCloser, keys []byte) (written int64 <ide> // ShouldRestart decides whether the daemon should restart the container or not. <ide> // This is based on the container's restart policy. <ide> func (container *Container) ShouldRestart() bool { <del> return container.HostConfig.RestartPolicy.Name == "always" || <del> (container.HostConfig.RestartPolicy.Name == "unless-stopped" && !container.HasBeenManuallyStopped) || <del> (container.HostConfig.RestartPolicy.Name == "on-failure" && container.ExitCode != 0) <add> shouldRestart, _, _ := container.restartManager.ShouldRestart(uint32(container.ExitCode), container.HasBeenManuallyStopped) <add> return shouldRestart <ide> } <ide> <ide> // AddBindMountPoint adds a new bind mount point configuration to the container. <ide> func (container *Container) RestartManager(reset bool) restartmanager.RestartMan <ide> container.restartManager = nil <ide> } <ide> if container.restartManager == nil { <del> container.restartManager = restartmanager.New(container.HostConfig.RestartPolicy) <add> container.restartManager = restartmanager.New(container.HostConfig.RestartPolicy, container.RestartCount) <ide> } <add> <ide> return container.restartManager <ide> } <ide> <ide><path>daemon/daemon.go <ide> func (daemon *Daemon) restore() error { <ide> wg.Add(1) <ide> go func(c *container.Container) { <ide> defer wg.Done() <add> rm := c.RestartManager(false) <ide> if c.IsRunning() || c.IsPaused() { <ide> // Fix activityCount such that graph mounts can be unmounted later <ide> if err := daemon.layerStore.ReinitRWLayer(c.RWLayer); err != nil { <ide> logrus.Errorf("Failed to ReinitRWLayer for %s due to %s", c.ID, err) <ide> return <ide> } <del> if err := daemon.containerd.Restore(c.ID, libcontainerd.WithRestartManager(c.RestartManager(true))); err != nil { <add> if err := daemon.containerd.Restore(c.ID, libcontainerd.WithRestartManager(rm)); err != nil { <ide> logrus.Errorf("Failed to restore with containerd: %q", err) <ide> return <ide> } <ide><path>integration-cli/docker_cli_daemon_test.go <ide> func (s *DockerDaemonSuite) TestDaemonRestartUnlessStopped(c *check.C) { <ide> <ide> } <ide> <add>func (s *DockerDaemonSuite) TestDaemonRestartOnFailure(c *check.C) { <add> err := s.d.StartWithBusybox() <add> c.Assert(err, check.IsNil) <add> <add> out, err := s.d.Cmd("run", "-d", "--name", "test1", "--restart", "on-failure:3", "busybox:latest", "false") <add> c.Assert(err, check.IsNil, check.Commentf("run top1: %v", out)) <add> <add> // wait test1 to stop <add> hostArgs := []string{"--host", s.d.sock()} <add> err = waitInspectWithArgs("test1", "{{.State.Running}} {{.State.Restarting}}", "false false", 10*time.Second, hostArgs...) <add> c.Assert(err, checker.IsNil, check.Commentf("test1 should exit but not")) <add> <add> // record last start time <add> out, err = s.d.Cmd("inspect", "-f={{.State.StartedAt}}", "test1") <add> c.Assert(err, checker.IsNil, check.Commentf("out: %v", out)) <add> lastStartTime := out <add> <add> err = s.d.Restart() <add> c.Assert(err, check.IsNil) <add> <add> // test1 shouldn't restart at all <add> err = waitInspectWithArgs("test1", "{{.State.Running}} {{.State.Restarting}}", "false false", 0, hostArgs...) <add> c.Assert(err, checker.IsNil, check.Commentf("test1 should exit but not")) <add> <add> // make sure test1 isn't restarted when daemon restart <add> // if "StartAt" time updates, means test1 was once restarted. <add> out, err = s.d.Cmd("inspect", "-f={{.State.StartedAt}}", "test1") <add> c.Assert(err, checker.IsNil, check.Commentf("out: %v", out)) <add> c.Assert(out, checker.Equals, lastStartTime, check.Commentf("test1 shouldn't start after daemon restarts")) <add>} <add> <ide> func (s *DockerDaemonSuite) TestDaemonStartIptablesFalse(c *check.C) { <ide> if err := s.d.Start("--iptables=false"); err != nil { <ide> c.Fatalf("we should have been able to start the daemon with passing iptables=false: %v", err) <ide><path>libcontainerd/container_linux.go <ide> func (ctr *container) handleEvent(e *containerd.Event) error { <ide> st.State = StateExitProcess <ide> } <ide> if st.State == StateExit && ctr.restartManager != nil { <del> restart, wait, err := ctr.restartManager.ShouldRestart(e.Status) <add> restart, wait, err := ctr.restartManager.ShouldRestart(e.Status, false) <ide> if err != nil { <ide> logrus.Error(err) <ide> } else if restart { <ide><path>libcontainerd/container_windows.go <ide> func (ctr *container) waitExit(pid uint32, processFriendlyName string, isFirstPr <ide> defer ctr.client.unlock(ctr.containerID) <ide> <ide> if si.State == StateExit && ctr.restartManager != nil { <del> restart, wait, err := ctr.restartManager.ShouldRestart(uint32(exitCode)) <add> restart, wait, err := ctr.restartManager.ShouldRestart(uint32(exitCode), false) <ide> if err != nil { <ide> logrus.Error(err) <ide> } else if restart { <ide><path>restartmanager/restartmanager.go <ide> const ( <ide> // RestartManager defines object that controls container restarting rules. <ide> type RestartManager interface { <ide> Cancel() error <del> ShouldRestart(exitCode uint32) (bool, chan error, error) <add> ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool) (bool, chan error, error) <ide> } <ide> <ide> type restartManager struct { <ide> sync.Mutex <ide> sync.Once <ide> policy container.RestartPolicy <del> failureCount int <add> restartCount int <ide> timeout time.Duration <ide> active bool <ide> cancel chan struct{} <ide> canceled bool <ide> } <ide> <ide> // New returns a new restartmanager based on a policy. <del>func New(policy container.RestartPolicy) RestartManager { <del> return &restartManager{policy: policy, cancel: make(chan struct{})} <add>func New(policy container.RestartPolicy, restartCount int) RestartManager { <add> return &restartManager{policy: policy, restartCount: restartCount, cancel: make(chan struct{})} <ide> } <ide> <ide> func (rm *restartManager) SetPolicy(policy container.RestartPolicy) { <ide> func (rm *restartManager) SetPolicy(policy container.RestartPolicy) { <ide> rm.Unlock() <ide> } <ide> <del>func (rm *restartManager) ShouldRestart(exitCode uint32) (bool, chan error, error) { <add>func (rm *restartManager) ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool) (bool, chan error, error) { <ide> rm.Lock() <ide> unlockOnExit := true <ide> defer func() { <ide> func (rm *restartManager) ShouldRestart(exitCode uint32) (bool, chan error, erro <ide> return false, nil, fmt.Errorf("invalid call on active restartmanager") <ide> } <ide> <del> if exitCode != 0 { <del> rm.failureCount++ <del> } else { <del> rm.failureCount = 0 <del> } <del> <ide> if rm.timeout == 0 { <ide> rm.timeout = defaultTimeout <ide> } else { <ide> func (rm *restartManager) ShouldRestart(exitCode uint32) (bool, chan error, erro <ide> <ide> var restart bool <ide> switch { <del> case rm.policy.IsAlways(), rm.policy.IsUnlessStopped(): <add> case rm.policy.IsAlways(): <add> restart = true <add> case rm.policy.IsUnlessStopped() && !hasBeenManuallyStopped: <ide> restart = true <ide> case rm.policy.IsOnFailure(): <ide> // the default value of 0 for MaximumRetryCount means that we will not enforce a maximum count <del> if max := rm.policy.MaximumRetryCount; max == 0 || rm.failureCount <= max { <add> if max := rm.policy.MaximumRetryCount; max == 0 || rm.restartCount < max { <ide> restart = exitCode != 0 <ide> } <ide> } <ide> func (rm *restartManager) ShouldRestart(exitCode uint32) (bool, chan error, erro <ide> return false, nil, nil <ide> } <ide> <add> rm.restartCount++ <add> <ide> unlockOnExit = false <ide> rm.active = true <ide> rm.Unlock()
6
Go
Go
move client-opts to a separate file
01eb35bfb3839436c2e5d2182b5f200008fd58a8
<ide><path>client/client.go <ide> import ( <ide> "net" <ide> "net/http" <ide> "net/url" <del> "os" <ide> "path" <del> "path/filepath" <ide> "strings" <ide> <ide> "github.com/docker/docker/api" <ide> "github.com/docker/docker/api/types" <ide> "github.com/docker/docker/api/types/versions" <ide> "github.com/docker/go-connections/sockets" <del> "github.com/docker/go-connections/tlsconfig" <ide> "github.com/pkg/errors" <ide> ) <ide> <ide> func NewEnvClient() (*Client, error) { <ide> return NewClientWithOpts(FromEnv) <ide> } <ide> <del>// FromEnv configures the client with values from environment variables. <del>// <del>// Supported environment variables: <del>// DOCKER_HOST to set the url to the docker server. <del>// DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest. <del>// DOCKER_CERT_PATH to load the TLS certificates from. <del>// DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default. <del>func FromEnv(c *Client) error { <del> if dockerCertPath := os.Getenv("DOCKER_CERT_PATH"); dockerCertPath != "" { <del> options := tlsconfig.Options{ <del> CAFile: filepath.Join(dockerCertPath, "ca.pem"), <del> CertFile: filepath.Join(dockerCertPath, "cert.pem"), <del> KeyFile: filepath.Join(dockerCertPath, "key.pem"), <del> InsecureSkipVerify: os.Getenv("DOCKER_TLS_VERIFY") == "", <del> } <del> tlsc, err := tlsconfig.Client(options) <del> if err != nil { <del> return err <del> } <del> <del> c.client = &http.Client{ <del> Transport: &http.Transport{TLSClientConfig: tlsc}, <del> CheckRedirect: CheckRedirect, <del> } <del> } <del> <del> if host := os.Getenv("DOCKER_HOST"); host != "" { <del> if err := WithHost(host)(c); err != nil { <del> return err <del> } <del> } <del> <del> if version := os.Getenv("DOCKER_API_VERSION"); version != "" { <del> c.version = version <del> c.manualOverride = true <del> } <del> return nil <del>} <del> <del>// WithTLSClientConfig applies a tls config to the client transport. <del>func WithTLSClientConfig(cacertPath, certPath, keyPath string) func(*Client) error { <del> return func(c *Client) error { <del> opts := tlsconfig.Options{ <del> CAFile: cacertPath, <del> CertFile: certPath, <del> KeyFile: keyPath, <del> ExclusiveRootPools: true, <del> } <del> config, err := tlsconfig.Client(opts) <del> if err != nil { <del> return errors.Wrap(err, "failed to create tls config") <del> } <del> if transport, ok := c.client.Transport.(*http.Transport); ok { <del> transport.TLSClientConfig = config <del> return nil <del> } <del> return errors.Errorf("cannot apply tls config to transport: %T", c.client.Transport) <del> } <del>} <del> <del>// WithDialer applies the dialer.DialContext to the client transport. This can be <del>// used to set the Timeout and KeepAlive settings of the client. <del>// Deprecated: use WithDialContext <del>func WithDialer(dialer *net.Dialer) func(*Client) error { <del> return WithDialContext(dialer.DialContext) <del>} <del> <del>// WithDialContext applies the dialer to the client transport. This can be <del>// used to set the Timeout and KeepAlive settings of the client. <del>func WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) func(*Client) error { <del> return func(c *Client) error { <del> if transport, ok := c.client.Transport.(*http.Transport); ok { <del> transport.DialContext = dialContext <del> return nil <del> } <del> return errors.Errorf("cannot apply dialer to transport: %T", c.client.Transport) <del> } <del>} <del> <del>// WithVersion overrides the client version with the specified one <del>func WithVersion(version string) func(*Client) error { <del> return func(c *Client) error { <del> c.version = version <del> return nil <del> } <del>} <del> <del>// WithHost overrides the client host with the specified one. <del>func WithHost(host string) func(*Client) error { <del> return func(c *Client) error { <del> hostURL, err := ParseHostURL(host) <del> if err != nil { <del> return err <del> } <del> c.host = host <del> c.proto = hostURL.Scheme <del> c.addr = hostURL.Host <del> c.basePath = hostURL.Path <del> if transport, ok := c.client.Transport.(*http.Transport); ok { <del> return sockets.ConfigureTransport(transport, c.proto, c.addr) <del> } <del> return errors.Errorf("cannot apply host to transport: %T", c.client.Transport) <del> } <del>} <del> <del>// WithHTTPClient overrides the client http client with the specified one <del>func WithHTTPClient(client *http.Client) func(*Client) error { <del> return func(c *Client) error { <del> if client != nil { <del> c.client = client <del> } <del> return nil <del> } <del>} <del> <del>// WithHTTPHeaders overrides the client default http headers <del>func WithHTTPHeaders(headers map[string]string) func(*Client) error { <del> return func(c *Client) error { <del> c.customHTTPHeaders = headers <del> return nil <del> } <del>} <del> <del>// WithScheme overrides the client scheme with the specified one <del>func WithScheme(scheme string) func(*Client) error { <del> return func(c *Client) error { <del> c.scheme = scheme <del> return nil <del> } <del>} <del> <ide> // NewClientWithOpts initializes a new API client with default values. It takes functors <ide> // to modify values when creating it, like `NewClientWithOpts(WithVersion(…))` <ide> // It also initializes the custom http headers to add to each request. <ide><path>client/options.go <add>package client <add> <add>import ( <add> "context" <add> "net" <add> "net/http" <add> "os" <add> "path/filepath" <add> <add> "github.com/docker/go-connections/sockets" <add> "github.com/docker/go-connections/tlsconfig" <add> "github.com/pkg/errors" <add>) <add> <add>// FromEnv configures the client with values from environment variables. <add>// <add>// Supported environment variables: <add>// DOCKER_HOST to set the url to the docker server. <add>// DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest. <add>// DOCKER_CERT_PATH to load the TLS certificates from. <add>// DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default. <add>func FromEnv(c *Client) error { <add> if dockerCertPath := os.Getenv("DOCKER_CERT_PATH"); dockerCertPath != "" { <add> options := tlsconfig.Options{ <add> CAFile: filepath.Join(dockerCertPath, "ca.pem"), <add> CertFile: filepath.Join(dockerCertPath, "cert.pem"), <add> KeyFile: filepath.Join(dockerCertPath, "key.pem"), <add> InsecureSkipVerify: os.Getenv("DOCKER_TLS_VERIFY") == "", <add> } <add> tlsc, err := tlsconfig.Client(options) <add> if err != nil { <add> return err <add> } <add> <add> c.client = &http.Client{ <add> Transport: &http.Transport{TLSClientConfig: tlsc}, <add> CheckRedirect: CheckRedirect, <add> } <add> } <add> <add> if host := os.Getenv("DOCKER_HOST"); host != "" { <add> if err := WithHost(host)(c); err != nil { <add> return err <add> } <add> } <add> <add> if version := os.Getenv("DOCKER_API_VERSION"); version != "" { <add> c.version = version <add> c.manualOverride = true <add> } <add> return nil <add>} <add> <add>// WithDialer applies the dialer.DialContext to the client transport. This can be <add>// used to set the Timeout and KeepAlive settings of the client. <add>// Deprecated: use WithDialContext <add>func WithDialer(dialer *net.Dialer) func(*Client) error { <add> return WithDialContext(dialer.DialContext) <add>} <add> <add>// WithDialContext applies the dialer to the client transport. This can be <add>// used to set the Timeout and KeepAlive settings of the client. <add>func WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) func(*Client) error { <add> return func(c *Client) error { <add> if transport, ok := c.client.Transport.(*http.Transport); ok { <add> transport.DialContext = dialContext <add> return nil <add> } <add> return errors.Errorf("cannot apply dialer to transport: %T", c.client.Transport) <add> } <add>} <add> <add>// WithHost overrides the client host with the specified one. <add>func WithHost(host string) func(*Client) error { <add> return func(c *Client) error { <add> hostURL, err := ParseHostURL(host) <add> if err != nil { <add> return err <add> } <add> c.host = host <add> c.proto = hostURL.Scheme <add> c.addr = hostURL.Host <add> c.basePath = hostURL.Path <add> if transport, ok := c.client.Transport.(*http.Transport); ok { <add> return sockets.ConfigureTransport(transport, c.proto, c.addr) <add> } <add> return errors.Errorf("cannot apply host to transport: %T", c.client.Transport) <add> } <add>} <add> <add>// WithHTTPClient overrides the client http client with the specified one <add>func WithHTTPClient(client *http.Client) func(*Client) error { <add> return func(c *Client) error { <add> if client != nil { <add> c.client = client <add> } <add> return nil <add> } <add>} <add> <add>// WithHTTPHeaders overrides the client default http headers <add>func WithHTTPHeaders(headers map[string]string) func(*Client) error { <add> return func(c *Client) error { <add> c.customHTTPHeaders = headers <add> return nil <add> } <add>} <add> <add>// WithScheme overrides the client scheme with the specified one <add>func WithScheme(scheme string) func(*Client) error { <add> return func(c *Client) error { <add> c.scheme = scheme <add> return nil <add> } <add>} <add> <add>// WithTLSClientConfig applies a tls config to the client transport. <add>func WithTLSClientConfig(cacertPath, certPath, keyPath string) func(*Client) error { <add> return func(c *Client) error { <add> opts := tlsconfig.Options{ <add> CAFile: cacertPath, <add> CertFile: certPath, <add> KeyFile: keyPath, <add> ExclusiveRootPools: true, <add> } <add> config, err := tlsconfig.Client(opts) <add> if err != nil { <add> return errors.Wrap(err, "failed to create tls config") <add> } <add> if transport, ok := c.client.Transport.(*http.Transport); ok { <add> transport.TLSClientConfig = config <add> return nil <add> } <add> return errors.Errorf("cannot apply tls config to transport: %T", c.client.Transport) <add> } <add>} <add> <add>// WithVersion overrides the client version with the specified one <add>func WithVersion(version string) func(*Client) error { <add> return func(c *Client) error { <add> c.version = version <add> return nil <add> } <add>}
2
Ruby
Ruby
add backtrace cleaner on test unit railtie
345e0b274cb384f8d453256e90dd105e6c2ffa19
<ide><path>activesupport/lib/active_support/test_case.rb <ide> class TestCase < ::Test::Unit::TestCase <ide> alias_method :method_name, :name if method_defined? :name <ide> alias_method :method_name, :__name__ if method_defined? :__name__ <ide> else <del> # TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit <del> if defined?(Rails) && ENV['BACKTRACE'].nil? <del> require 'rails/backtrace_cleaner' <del> Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit } <del> end <del> <ide> Assertion = Test::Unit::AssertionFailedError <ide> <ide> require 'active_support/testing/default' <ide><path>railties/lib/rails/test_unit/railtie.rb <ide> class TestUnitRailtie < Rails::Railtie <ide> rake_tasks do <ide> load "rails/test_unit/testing.rake" <ide> end <add> <add> initializer "test_unit.backtrace_cleaner" do <add> # TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit <add> unless defined?(Minitest) || ENV['BACKTRACE'] <add> require 'rails/backtrace_cleaner' <add> Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit } <add> end <add> end <ide> end <ide> end <ide>\ No newline at end of file
2
Text
Text
fix language names in jquery section of guide
48312b3ff964e81855444d193c4ef2338a44136e
<ide><path>guide/english/certifications/front-end-libraries/jquery/target-html-elements-with-selectors-using-jquery/index.md <ide> title: Target HTML Elements with Selectors Using jQuery <ide> - You can "find" (or select) HTML elements based on their name, id, classes, types, attributes, values of attributes and much more. <ide> <ide> ## Example <del>```javascipt <add>```js <ide> //You can select all <p> elements on a page like this = $("p") <ide> $(document).ready(function(){ <ide> $("button").click(function(){ <ide> title: Target HTML Elements with Selectors Using jQuery <ide> <ide> <ide> ## Solution <del>```javascript <add>```html <ide> <script> <ide> $(document).ready(function() { <ide> $("button").addClass("animated bounce"); // We are selecting the button elements and adding "animated bounce" class to them. <ide><path>guide/english/certifications/front-end-libraries/jquery/target-the-parent-of-an-element-using-jquery/index.md <ide> title: Target the Parent of an Element Using jQuery <ide> <ide> ## Solution <ide> <del>```js <add>```html <ide> <script> <ide> $(document).ready(function() { <ide> $("#target1").parent().css("background-color", "red"); // Selects the parent of #target1 and changes its background-color to red <ide><path>guide/english/certifications/front-end-libraries/jquery/target-the-same-element-with-multiple-jquery-selectors/index.md <ide> title: Target the Same Element with Multiple jQuery Selectors <ide> ## Target the Same Element with Multiple jQuery Selectors <ide> <ide> ## Solution <del>```javascript <add>```html <ide> <script> <ide> $(document).ready(function() { <ide> $("button").addClass("animated"); // Target elements with type "button" and add the class "animated" to them.
3
Python
Python
add ability to test layers on dynamic shapes
9333179ad96fad2760221f2b3e2dec31f7c77f40
<ide><path>keras/utils/test_utils.py <ide> def layer_test(layer_cls, kwargs={}, input_shape=None, input_dtype=None, <ide> assert input_shape <ide> if not input_dtype: <ide> input_dtype = K.floatx() <del> input_data = (10 * np.random.random(input_shape)).astype(input_dtype) <add> input_data_shape = list(input_shape) <add> for i, e in enumerate(input_data_shape): <add> if e is None: <add> input_data_shape[i] = np.random.randint(1, 4) <add> input_data = (10 * np.random.random(input_data_shape)) <add> input_data = input_data.astype(input_dtype) <ide> elif input_shape is None: <ide> input_shape = input_data.shape <ide> <ide> def layer_test(layer_cls, kwargs={}, input_shape=None, input_dtype=None, <ide> expected_output_shape = layer.get_output_shape_for(input_shape) <ide> actual_output = model.predict(input_data) <ide> actual_output_shape = actual_output.shape <del> assert expected_output_shape == actual_output_shape <add> for expected_dim, actual_dim in zip(expected_output_shape, <add> actual_output_shape): <add> if expected_dim is not None: <add> assert expected_dim == actual_dim <ide> if expected_output is not None: <ide> assert_allclose(actual_output, expected_output, rtol=1e-3) <ide> <ide> def layer_test(layer_cls, kwargs={}, input_shape=None, input_dtype=None, <ide> model.compile('rmsprop', 'mse') <ide> actual_output = model.predict(input_data) <ide> actual_output_shape = actual_output.shape <del> assert expected_output_shape == actual_output_shape <add> for expected_dim, actual_dim in zip(expected_output_shape, <add> actual_output_shape): <add> if expected_dim is not None: <add> assert expected_dim == actual_dim <ide> if expected_output is not None: <ide> assert_allclose(actual_output, expected_output, rtol=1e-3) <ide> <ide><path>tests/keras/layers/test_core.py <ide> def test_dense(): <ide> kwargs={'output_dim': 3}, <ide> input_shape=(3, 4, 2)) <ide> <add> layer_test(core.Dense, <add> kwargs={'output_dim': 3}, <add> input_shape=(None, None, 2)) <add> <ide> layer_test(core.Dense, <ide> kwargs={'output_dim': 3}, <ide> input_shape=(3, 4, 5, 2))
2
Ruby
Ruby
recommend gh over hub
0447b2200ff5da3d249d0f6cedb79ea0cbb4ce3b
<ide><path>Library/Homebrew/dev-cmd/pull.rb <ide> def pull_args <ide> end <ide> <ide> def pull <del> odisabled "brew pull", "hub checkout" <add> odisabled "brew pull", "gh pr checkout" <ide> end <ide> end
1
Python
Python
use grid sampling to paste masks
430819908c10d8068d58af26cd60e7001ab51a2a
<ide><path>official/vision/beta/projects/panoptic_maskrcnn/modeling/layers/panoptic_segmentation_generator.py <ide> <ide> import tensorflow as tf <ide> <add>from official.vision.beta.projects.panoptic_maskrcnn.modeling.layers import paste_masks <ide> <ide> class PanopticSegmentationGenerator(tf.keras.layers.Layer): <ide> """Panoptic segmentation generator layer.""" <ide> def __init__( <ide> } <ide> super(PanopticSegmentationGenerator, self).__init__(**kwargs) <ide> <del> def _paste_mask(self, box, mask): <del> pasted_mask = tf.ones( <del> self._output_size + [1], dtype=mask.dtype) * self._void_class_label <del> <del> ymin = tf.clip_by_value(box[0], 0, self._output_size[0]) <del> xmin = tf.clip_by_value(box[1], 0, self._output_size[1]) <del> ymax = tf.clip_by_value(box[2] + 1, 0, self._output_size[0]) <del> xmax = tf.clip_by_value(box[3] + 1, 0, self._output_size[1]) <del> box_height = ymax - ymin <del> box_width = xmax - xmin <del> <del> if not (box_height == 0 or box_width == 0): <del> # resize mask to match the shape of the instance bounding box <del> resized_mask = tf.image.resize( <del> mask, <del> size=(box_height, box_width), <del> method='bilinear') <del> resized_mask = tf.cast(resized_mask, dtype=mask.dtype) <del> <del> # paste resized mask on a blank mask that matches image shape <del> pasted_mask = tf.raw_ops.TensorStridedSliceUpdate( <del> input=pasted_mask, <del> begin=[ymin, xmin], <del> end=[ymax, xmax], <del> strides=[1, 1], <del> value=resized_mask) <del> <del> return pasted_mask <add> def build(self, input_shape): <add> grid_sampler = paste_masks.BilinearGridSampler(align_corners=False) <add> self._paste_masks_fn = paste_masks.PasteMasks( <add> output_size=self._output_size, grid_sampler=grid_sampler) <ide> <ide> def _generate_panoptic_masks(self, boxes, scores, classes, detections_masks, <ide> segmentation_mask): <ide> def _generate_panoptic_masks(self, boxes, scores, classes, detections_masks, <ide> - category_mask: A `tf.Tensor` for category masks. <ide> - instance_mask: A `tf.Tensor for instance masks. <ide> """ <add> # Paste instance masks <add> pasted_masks = self._paste_masks_fn((detections_masks, boxes)) <add> <ide> # Offset stuff class predictions <ide> segmentation_mask = tf.where( <ide> tf.logical_or( <ide> def _generate_panoptic_masks(self, boxes, scores, classes, detections_masks, <ide> instance_mask = tf.ones( <ide> mask_shape, dtype=tf.float32) * self._void_instance_id <ide> <add> <ide> # filter instances with low confidence <ide> sorted_scores = tf.sort(scores, direction='DESCENDING') <ide> <ide> def _generate_panoptic_masks(self, boxes, scores, classes, detections_masks, <ide> # the overlaps are resolved based on confidence score <ide> instance_idx = sorted_indices[i] <ide> <del> pasted_mask = self._paste_mask( <del> box=boxes[instance_idx], <del> mask=detections_masks[instance_idx]) <add> pasted_mask = pasted_masks[instance_idx] <ide> <ide> class_id = tf.cast(classes[instance_idx], dtype=tf.float32) <ide> <ide> def call(self, inputs): <ide> <ide> batched_scores = detections['detection_scores'] <ide> batched_classes = detections['detection_classes'] <del> batched_boxes = tf.cast(detections['detection_boxes'], dtype=tf.int32) <add> batched_boxes = detections['detection_boxes'] <ide> batched_detections_masks = tf.expand_dims( <ide> detections['detection_masks'], axis=-1) <ide>
1
Mixed
Ruby
fix custom join_table name on habtm reflections
18fa87b8663ac88fd280e9860505598fe04cd46a
<ide><path>activerecord/CHANGELOG.md <add>* When using a custom `join_table` name on a `habtm`, rails was not saving it <add> on Reflections. This causes a problem when rails loads fixtures, because it <add> uses the reflections to set database with fixtures. <add> <add> Fixes #14845. <add> <add> *Kassio Borges* <add> <ide> * Reset the cache when modifying a Relation with cached Arel. <ide> Additionally display a warning message to make the user aware. <ide> <ide><path>activerecord/lib/active_record/associations.rb <ide> def destroy_associations <ide> hm_options[:through] = middle_reflection.name <ide> hm_options[:source] = join_model.right_reflection.name <ide> <del> [:before_add, :after_add, :before_remove, :after_remove, :autosave, :validate].each do |k| <add> [:before_add, :after_add, :before_remove, :after_remove, :autosave, :validate, :join_table].each do |k| <ide> hm_options[k] = options[k] if options.key? k <ide> end <ide> <ide><path>activerecord/lib/active_record/associations/builder/has_many.rb <ide> def macro <ide> end <ide> <ide> def valid_options <del> super + [:primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache] <add> super + [:primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table] <ide> end <ide> <ide> def self.valid_dependent_options <ide><path>activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb <ide> require 'models/sponsor' <ide> require 'models/country' <ide> require 'models/treaty' <add>require 'models/vertex' <ide> require 'active_support/core_ext/string/conversions' <ide> <ide> class ProjectWithAfterCreateHook < ActiveRecord::Base <ide> def test_association_with_validate_false_does_not_run_associated_validation_call <ide> assert_equal 1, treasure.rich_people.size <ide> assert_equal person_first_name, rich_person.first_name, 'should not run associated person validation on update when validate: false' <ide> end <add> <add> def test_custom_join_table <add> assert_equal 'edges', Vertex.reflect_on_association(:sources).join_table <add> end <ide> end
4
Ruby
Ruby
improve activerecord strict_loading documentation
1b67adb819c97a406fac4d1b96302259fbceca1d
<ide><path>activerecord/lib/active_record/associations.rb <ide> module ClassMethods <ide> # Useful for defining methods on associations, especially when they should be shared between multiple <ide> # association objects. <ide> # [:strict_loading] <del> # Enforces strict loading every time the associated record is loaded through this association. <add> # When set to +true+, enforces strict loading every time the associated record is loaded through this <add> # association. <ide> # [:ensuring_owner_was] <ide> # Specifies an instance method to be called on the owner. The method must return true in order for the <ide> # associated records to be deleted in a background job.
1
Python
Python
add repr(value) to the assert msg in fieldvalues
ae95ed1ec2514becb6e2e41d47b8fd3c8b9c8f66
<ide><path>tests/test_fields.py <ide> def test_valid_inputs(self): <ide> Ensure that valid values return the expected validated data. <ide> """ <ide> for input_value, expected_output in get_items(self.valid_inputs): <del> assert self.field.run_validation(input_value) == expected_output <add> assert self.field.run_validation(input_value) == expected_output, \ <add> 'input value: {}'.format(repr(input_value)) <ide> <ide> def test_invalid_inputs(self): <ide> """ <ide> def test_invalid_inputs(self): <ide> for input_value, expected_failure in get_items(self.invalid_inputs): <ide> with pytest.raises(serializers.ValidationError) as exc_info: <ide> self.field.run_validation(input_value) <del> assert exc_info.value.detail == expected_failure <add> assert exc_info.value.detail == expected_failure, \ <add> 'input value: {}'.format(repr(input_value)) <ide> <ide> def test_outputs(self): <ide> for output_value, expected_output in get_items(self.outputs): <del> assert self.field.to_representation(output_value) == expected_output <add> assert self.field.to_representation(output_value) == expected_output, \ <add> 'output value: {}'.format(repr(output_value)) <ide> <ide> <ide> # Boolean types...
1
Text
Text
update relation to other libraries.md
08199a0abe7410c9e7bd2104d7742900a4ab628d
<ide><path>docs/Basics/Relation to Other Libraries.md <ide> Immutable and most similar libraries are orthogonal to Redux. Feel free to use t <ide> <ide> **Redux doesn’t care *how* you store the state—it can be a plain object, an Immutable object, or anything else.** You’ll probably want a (de)serialization mechanism for writing universal apps and hydrating their state from the server, but other than that, you can use any data storage library *as long as it supports immutability*. For example, it doesn’t make sense to use Backbone for Redux state, because Backbone models are mutable. <ide> <del>Note that if your immutable library supports cursors, you should not use them in a Redux app. The whole tree should be considered read-only, and you should use Redux for updating the state, and subscribing to the updates. **If you’re happy with cursors, you don’t need Redux.** <add>Note that, even if your immutable library supports cursors, you shouldn’t use them in a Redux app. The whole state tree should be considered read-only, and you should use Redux for updating the state, and subscribing to the updates. Therefore writing via cursor doesn’t make sense for Redux. **If your only use case for cursors is decoupling the state tree from the UI tree and gradually refining the cursors, you should look at selectors instead.** Selectors are composable getter functions. See [reselect](http://github.com/faassen/reselect) for a really great and concise implementation of composable selectors. <ide> <ide> ### Baobab <ide>
1
Javascript
Javascript
fix redos in color.js
0f5de4f5da1014f81c00d309f93b1a1e709341e4
<ide><path>src/math/Color.js <ide> class Color { <ide> <ide> let color; <ide> const name = m[ 1 ]; <del> const components = m[ 2 ]; <add> const components = m[ 2 ].replace(/^\s*/, ''); <ide> <ide> switch ( name ) { <ide> <ide> case 'rgb': <ide> case 'rgba': <ide> <del> if ( color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) { <add> if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) { <ide> <ide> // rgb(255,0,0) rgba(255,0,0,0.5) <ide> this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255;
1
Javascript
Javascript
add 5 sec timeout to test-tls-securepair-client
033ab7ebb6773f6831846fff1b6366adb4d798fb
<ide><path>test/simple/test-tls-securepair-client.js <ide> server.stdout.on('data', function(s) { <ide> }); <ide> <ide> <add>var timeout = setTimeout(function () { <add> server.kill(); <add> process.exit(1); <add>}, 5000); <add> <add> <ide> var serverExitCode = -1; <ide> server.on('exit', function(code) { <ide> serverExitCode = code; <add> clearTimeout(timeout); <ide> }); <ide> <ide>
1
Javascript
Javascript
improve interpolation service add documentation
5001c1a1217772d2bffe108bafd475b24badf559
<ide><path>src/service/interpolate.js <ide> 'use strict'; <ide> <del>function $InterpolateProvider(){ <del> this.$get = ['$parse', function($parse){ <del> return function(text, templateOnly) { <del> var bindings = parseBindings(text); <del> if (hasBindings(bindings) || !templateOnly) { <del> return compileBindTemplate(text); <del> } <del> }; <del> }]; <del>} <add>/** <add> * @ngdoc function <add> * @name angular.module.ng.$interpolateProvider <add> * @function <add> * <add> * @description <add> * <add> * Used for configuring the interpolation markup. Deafults to `{{` and `}}`. <add> */ <add>function $InterpolateProvider() { <add> var startSymbol = '{{'; <add> var endSymbol = '}}'; <ide> <del>var bindTemplateCache = {}; <del>function compileBindTemplate(template){ <del> var fn = bindTemplateCache[template]; <del> if (!fn) { <del> var bindings = []; <del> forEach(parseBindings(template), function(text){ <del> var exp = binding(text); <del> bindings.push(exp <del> ? function(scope, element) { return scope.$eval(exp); } <del> : function() { return text; }); <del> }); <del> bindTemplateCache[template] = fn = function(scope, element, prettyPrintJson) { <del> var parts = [], <del> hadOwnElement = scope.hasOwnProperty('$element'), <del> oldElement = scope.$element; <add> /** <add> * @ngdoc method <add> * @name angular.module.ng.$interpolateProvider#startSymbol <add> * @methodOf angular.module.ng.$interpolateProvider <add> * @description <add> * Symbol to denote start of expression in the interpolated string. Defaults to `{{`. <add> * <add> * @prop {string=} value new value to set the starting symbol to. <add> */ <add> this.startSymbol = function(value){ <add> if (value) { <add> startSymbol = value; <add> return this; <add> } else { <add> return startSymbol; <add> } <add> }; <ide> <del> // TODO(misko): get rid of $element <del> scope.$element = element; <del> try { <del> for (var i = 0; i < bindings.length; i++) { <del> var value = bindings[i](scope, element); <del> if (isElement(value)) <del> value = ''; <del> else if (isObject(value)) <del> value = toJson(value, prettyPrintJson); <del> parts.push(value); <del> } <del> return parts.join(''); <del> } finally { <del> if (hadOwnElement) { <del> scope.$element = oldElement; <del> } else { <del> delete scope.$element; <del> } <del> } <del> }; <del> } <del> return fn; <del>} <add> /** <add> * @ngdoc method <add> * @name angular.module.ng.$interpolateProvider#endSymbol <add> * @methodOf angular.module.ng.$interpolateProvider <add> * @description <add> * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. <add> * <add> * @prop {string=} value new value to set the ending symbol to. <add> */ <add> this.endSymbol = function(value){ <add> if (value) { <add> endSymbol = value; <add> return this; <add> } else { <add> return startSymbol; <add> } <add> }; <ide> <ide> <del>function parseBindings(string) { <del> var results = []; <del> var lastIndex = 0; <del> var index; <del> while((index = string.indexOf('{{', lastIndex)) > -1) { <del> if (lastIndex < index) <del> results.push(string.substr(lastIndex, index - lastIndex)); <del> lastIndex = index; <add> this.$get = ['$parse', function($parse) { <add> var startSymbolLength = startSymbol.length, <add> endSymbolLength = endSymbol.length; <ide> <del> index = string.indexOf('}}', index); <del> index = index < 0 ? string.length : index + 2; <add> /** <add> * @ngdoc function <add> * @name angular.module.ng.$interpolate <add> * @function <add> * <add> * @requires $parse <add> * <add> * @description <add> * <add> * Compiles a string with markup into an interpolation function. This service is used by the <add> * HTML {@link angular.module.ng.$compile $compile} service for data binding. See <add> * {@link angular.module.ng.$interpolateProvider $interpolateProvider} for configuring the <add> * interpolation markup. <add> * <add> * <add> <pre> <add> var $interpolate = ...; // injected <add> var exp = $interpolate('Hello {{name}}!'); <add> expect(exp({name:'Angular'}).toEqual('Hello Angular!'); <add> </pre> <add> * <add> * <add> * @param {string} text The text with markup to interpolate. <add> * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have <add> * embedded expression in order to return an interpolation function. Strings with no <add> * embedded expression will return null for the interpolation function. <add> * @returns {function(context)} an interpolation function which is used to compute the interpolated <add> * string. The function has these parameters: <add> * <add> * * `context`: an object against which any expressions embedded in the strings are evaluated <add> * against. <add> * <add> */ <add> return function(text, mustHaveExpression) { <add> var startIndex, <add> endIndex, <add> index = 0, <add> parts = [], <add> length = text.length, <add> hasInterpolation = false, <add> fn, <add> exp, <add> concat = []; <ide> <del> results.push(string.substr(lastIndex, index - lastIndex)); <del> lastIndex = index; <del> } <del> if (lastIndex != string.length) <del> results.push(string.substr(lastIndex, string.length - lastIndex)); <del> return results.length === 0 ? [ string ] : results; <del>} <add> while(index < length) { <add> if ( ((startIndex = text.indexOf(startSymbol, index)) != -1) && <add> ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1) ) { <add> (index != startIndex) && parts.push(text.substring(index, startIndex)); <add> parts.push(fn = $parse(exp = text.substring(startIndex + startSymbolLength, endIndex))); <add> fn.exp = exp; <add> index = endIndex + endSymbolLength; <add> hasInterpolation = true; <add> } else { <add> // we did not find anything, so we have to add the remainder to the parts array <add> (index != length) && parts.push(text.substring(index)); <add> index = length; <add> } <add> } <ide> <del>function binding(string) { <del> var binding = string.replace(/\n/gm, ' ').match(/^\{\{(.*)\}\}$/); <del> return binding ? binding[1] : null; <del>} <add> if (!(length = parts.length)) { <add> // we added, nothing, must have been an empty string. <add> parts.push(''); <add> length = 1; <add> } <ide> <del>function hasBindings(bindings) { <del> return bindings.length > 1 || binding(bindings[0]) !== null; <add> if (!mustHaveExpression || hasInterpolation) { <add> concat.length = length; <add> fn = function(context) { <add> for(var i = 0, ii = length, part; i<ii; i++) { <add> if (typeof (part = parts[i]) == 'function') { <add> part = part(context); <add> if (part == null || part == undefined) { <add> part = ''; <add> } else if (typeof part != 'string') { <add> part = toJson(part); <add> } <add> } <add> concat[i] = part; <add> } <add> return concat.join(''); <add> }; <add> fn.exp = text; <add> fn.parts = parts; <add> return fn; <add> } <add> }; <add> }]; <ide> } <add> <ide><path>test/markupSpec.js <ide> describe("markups", function() { <ide> expect(sortedHtml(element)).toEqual('<div href="some" ng:bind-attr="{"href":"some"}"></div>'); <ide> dealoc(element); <ide> })); <del> <del> it('should Parse Text With No Bindings', inject(function($rootScope, $compile) { <del> var parts = parseBindings("a"); <del> expect(parts.length).toBe(1); <del> expect(parts[0]).toBe("a"); <del> expect(binding(parts[0])).toBeFalsy(); <del> })); <del> <del> it('should Parse Empty Text', inject(function($rootScope, $compile) { <del> var parts = parseBindings(""); <del> expect(parts.length).toBe(1); <del> expect(parts[0]).toBe(""); <del> expect(binding(parts[0])).toBeFalsy(); <del> })); <del> <del> it('should Parse Inner Binding', inject(function($rootScope, $compile) { <del> var parts = parseBindings("a{{b}}C"); <del> expect(parts.length).toBe(3); <del> expect(parts[0]).toBe("a"); <del> expect(binding(parts[0])).toBeFalsy(); <del> expect(parts[1]).toBe("{{b}}"); <del> expect(binding(parts[1])).toBe("b"); <del> expect(parts[2]).toBe("C"); <del> expect(binding(parts[2])).toBeFalsy(); <del> })); <del> <del> it('should Parse Ending Binding', inject(function($rootScope, $compile) { <del> var parts = parseBindings("a{{b}}"); <del> expect(parts.length).toBe(2); <del> expect(parts[0]).toBe("a"); <del> expect(binding(parts[0])).toBeFalsy(); <del> expect(parts[1]).toBe("{{b}}"); <del> expect(binding(parts[1])).toBe("b"); <del> })); <del> <del> it('should Parse Begging Binding', inject(function($rootScope, $compile) { <del> var parts = parseBindings("{{b}}c"); <del> expect(parts.length).toBe(2); <del> expect(parts[0]).toBe("{{b}}"); <del> expect(binding(parts[0])).toBe("b"); <del> expect(parts[1]).toBe("c"); <del> expect(binding(parts[1])).toBeFalsy(); <del> })); <del> <del> it('should Parse Loan Binding', inject(function($rootScope, $compile) { <del> var parts = parseBindings("{{b}}"); <del> expect(parts.length).toBe(1); <del> expect(parts[0]).toBe("{{b}}"); <del> expect(binding(parts[0])).toBe("b"); <del> })); <del> <del> it('should Parse Two Bindings', inject(function($rootScope, $compile) { <del> var parts = parseBindings("{{b}}{{c}}"); <del> expect(parts.length).toBe(2); <del> expect(parts[0]).toBe("{{b}}"); <del> expect(binding(parts[0])).toBe("b"); <del> expect(parts[1]).toBe("{{c}}"); <del> expect(binding(parts[1])).toBe("c"); <del> })); <del> <del> it('should Parse Two Bindings With Text In Middle', inject(function($rootScope, $compile) { <del> var parts = parseBindings("{{b}}x{{c}}"); <del> expect(parts.length).toBe(3); <del> expect(parts[0]).toBe("{{b}}"); <del> expect(binding(parts[0])).toBe("b"); <del> expect(parts[1]).toBe("x"); <del> expect(binding(parts[1])).toBeFalsy(); <del> expect(parts[2]).toBe("{{c}}"); <del> expect(binding(parts[2])).toBe("c"); <del> })); <del> <del> it('should Parse Multiline', inject(function($rootScope, $compile) { <del> var parts = parseBindings('"X\nY{{A\nB}}C\nD"'); <del> expect(binding('{{A\nB}}')).toBeTruthy(); <del> expect(parts.length).toBe(3); <del> expect(parts[0]).toBe('"X\nY'); <del> expect(parts[1]).toBe('{{A\nB}}'); <del> expect(parts[2]).toBe('C\nD"'); <del> })); <del> <del> it('should Has Binding', inject(function($rootScope, $compile) { <del> expect(hasBindings(parseBindings("{{a}}"))).toBe(true); <del> expect(hasBindings(parseBindings("a"))).toBeFalsy(); <del> expect(hasBindings(parseBindings("{{b}}x{{c}}"))).toBe(true); <del> })); <del> <ide> }); <ide> <ide><path>test/service/interpolateSpec.js <ide> describe('$interpolate', function() { <ide> expect($interpolate('some text', true)).toBeUndefined(); <ide> })); <ide> <add> it('should suppress falsy objects', inject(function($interpolate) { <add> expect($interpolate('{{undefined}}')()).toEqual(''); <add> expect($interpolate('{{null}}')()).toEqual(''); <add> expect($interpolate('{{a.b}}')()).toEqual(''); <add> })); <add> <add> it('should jsonify objects', inject(function($interpolate) { <add> expect($interpolate('{{ {} }}')()).toEqual('{}'); <add> expect($interpolate('{{ true }}')()).toEqual('true'); <add> expect($interpolate('{{ false }}')()).toEqual('false'); <add> })); <add> <ide> <ide> it('should return interpolation function', inject(function($interpolate, $rootScope) { <ide> $rootScope.name = 'Misko'; <ide> expect($interpolate('Hello {{name}}!')($rootScope)).toEqual('Hello Misko!'); <ide> })); <add> <add> describe('provider', function() { <add> beforeEach(module(function($interpolateProvider) { <add> $interpolateProvider.startSymbol('--'); <add> $interpolateProvider.endSymbol('--'); <add> })); <add> <add> it('should not get confused with same markers', inject(function($interpolate) { <add> expect($interpolate('---').parts).toEqual(['---']); <add> expect($interpolate('----')()).toEqual(''); <add> expect($interpolate('--1--')()).toEqual('1'); <add> })); <add> }); <add> <add> describe('parseBindings', function() { <add> it('should Parse Text With No Bindings', inject(function($interpolate) { <add> var parts = $interpolate("a").parts; <add> expect(parts.length).toEqual(1); <add> expect(parts[0]).toEqual("a"); <add> })); <add> <add> it('should Parse Empty Text', inject(function($interpolate) { <add> var parts = $interpolate("").parts; <add> expect(parts.length).toEqual(1); <add> expect(parts[0]).toEqual(""); <add> })); <add> <add> it('should Parse Inner Binding', inject(function($interpolate) { <add> var parts = $interpolate("a{{b}}C").parts; <add> expect(parts.length).toEqual(3); <add> expect(parts[0]).toEqual("a"); <add> expect(parts[1].exp).toEqual("b"); <add> expect(parts[1]({b:123})).toEqual(123); <add> expect(parts[2]).toEqual("C"); <add> })); <add> <add> it('should Parse Ending Binding', inject(function($interpolate) { <add> var parts = $interpolate("a{{b}}").parts; <add> expect(parts.length).toEqual(2); <add> expect(parts[0]).toEqual("a"); <add> expect(parts[1].exp).toEqual("b"); <add> expect(parts[1]({b:123})).toEqual(123); <add> })); <add> <add> it('should Parse Begging Binding', inject(function($interpolate) { <add> var parts = $interpolate("{{b}}c").parts; <add> expect(parts.length).toEqual(2); <add> expect(parts[0].exp).toEqual("b"); <add> expect(parts[1]).toEqual("c"); <add> })); <add> <add> it('should Parse Loan Binding', inject(function($interpolate) { <add> var parts = $interpolate("{{b}}").parts; <add> expect(parts.length).toEqual(1); <add> expect(parts[0].exp).toEqual("b"); <add> })); <add> <add> it('should Parse Two Bindings', inject(function($interpolate) { <add> var parts = $interpolate("{{b}}{{c}}").parts; <add> expect(parts.length).toEqual(2); <add> expect(parts[0].exp).toEqual("b"); <add> expect(parts[1].exp).toEqual("c"); <add> })); <add> <add> it('should Parse Two Bindings With Text In Middle', inject(function($interpolate) { <add> var parts = $interpolate("{{b}}x{{c}}").parts; <add> expect(parts.length).toEqual(3); <add> expect(parts[0].exp).toEqual("b"); <add> expect(parts[1]).toEqual("x"); <add> expect(parts[2].exp).toEqual("c"); <add> })); <add> <add> it('should Parse Multiline', inject(function($interpolate) { <add> var parts = $interpolate('"X\nY{{A\n+B}}C\nD"').parts; <add> expect(parts.length).toEqual(3); <add> expect(parts[0]).toEqual('"X\nY'); <add> expect(parts[1].exp).toEqual('A\n+B'); <add> expect(parts[2]).toEqual('C\nD"'); <add> })); <add> }); <ide> });
3
Text
Text
add logo info to readme
b8c02632136320b8379956411134246cd2f6eb47
<ide><path>README.md <ide> Use Airflow to author workflows as directed acyclic graphs (DAGs) of tasks. The <ide> - [Contributing](#contributing) <ide> - [Who uses Apache Airflow?](#who-uses-apache-airflow) <ide> - [Who Maintains Apache Airflow?](#who-maintains-apache-airflow) <add>- [Can I use the Apache Airflow logo in my presentation?](#can-i-use-the-apache-airflow-logo-in-my-presentation) <ide> - [Links](#links) <ide> <ide> <!-- END doctoc generated TOC please keep comment here to allow auto update --> <ide> are responsible for reviewing and merging PRs as well as steering conversation a <ide> If you would like to become a maintainer, please review the Apache Airflow <ide> [committer requirements](https://cwiki.apache.org/confluence/display/AIRFLOW/Committers). <ide> <add>## Can I use the Apache Airflow logo in my presentation? <add> <add>Yes! Be sure to abide by the Apache Foundation [trademark policies](https://www.apache.org/foundation/marks/#books) and the Apache Airflow [Brandbook](https://cwiki.apache.org/confluence/display/AIRFLOW/Brandbook). The most up to date logos are found in [this repo](/docs/img/logos) and on the Apache Software Foundation [website](https://www.apache.org/logos/about.html). <add> <ide> ## Links <ide> <ide> - [Documentation](https://airflow.apache.org/)
1
Text
Text
update pull request template
1730648e195a854fc44d1970737cb128e874d0d5
<ide><path>.github/PULL_REQUEST_TEMPLATE.md <del><!--- Provide a general summary of your changes in the Title --> <add><!--- Provide a general summary of your changes in the title. --> <ide> <ide> ## Description <del><!--- Use this section to describe your changes and how they're affecting the code. --> <del><!-- If your changes required testing, include information about the testing environment and the tests you ran. --> <add><!--- Use this section to describe your changes. If your changes required <add>testing, include information about the testing environment and the tests you <add>ran. If your test fixes a bug reported in an issue, don't forget to include the <add>issue number. If your PR is still a work in progress, that's totally fine – just <add>include a note to let us know. --> <ide> <add>### Types of change <add><!-- What type of change does your PR cover? Is it a bug fix, an enhancement <add>or new feature, or a change to the documentation? --> <ide> <del>## Types of changes <del><!--- What types of changes does your code introduce? Put an `x` in all applicable boxes.: --> <del>- [ ] **Bug fix** (non-breaking change fixing an issue) <del>- [ ] **New feature** (non-breaking change adding functionality to spaCy) <del>- [ ] **Breaking change** (fix or feature causing change to spaCy's existing functionality) <del>- [ ] **Documentation** (addition to documentation of spaCy) <del> <del>## Checklist: <del><!--- Go over all the following points, and put an `x` in all applicable boxes.: --> <del>- [ ] My change requires a change to spaCy's documentation. <del>- [ ] I have updated the documentation accordingly. <del>- [ ] I have added tests to cover my changes. <del>- [ ] All new and existing tests passed. <add>## Checklist <add><!--- Before you submit the PR, go over this checklist and make sure you can <add>tick off all the boxes. [] -> [x] --> <add>- [ ] I have submitted the spaCy Contributor Agreement. <add>- [ ] I ran the tests, and all new and existing tests passed. <add>- [ ] My changes don't require a change to the documentation, or if they do, I've added all required information.
1
Python
Python
use e.args instead of e.message
ad57c406224fed23ad7e638e11290f6cb87b95a7
<ide><path>test/test_slicehost.py <ide> def test_list_nodes(self): <ide> try: <ide> ret = self.driver.list_nodes() <ide> except Exception, e: <del> self.assertEqual(e.message, 'HTTP Basic: Access denied.') <add> self.assertEqual(e.args[0], 'HTTP Basic: Access denied.') <ide> else: <ide> self.fail('test should have thrown') <ide> <ide> def test_reboot_node(self): <ide> try: <ide> ret = self.driver.reboot_node(node) <ide> except Exception, e: <del> self.assertEqual(e.message, 'Permission denied') <add> self.assertEqual(e.args[0], 'Permission denied') <ide> else: <ide> self.fail('test should have thrown') <ide>
1
PHP
PHP
apply fixes from styleci
89a4318365b39b5d2cce25356ecd4f50bfc51e0b
<ide><path>src/Illuminate/Database/Eloquent/SoftDeletes.php <ide> protected function runSoftDelete() <ide> <ide> $query->update([ <ide> $this->getDeletedAtColumn() => $this->fromDateTime($time), <del> $this->getUpdatedAtColumn() => $this->fromDateTime($time) <add> $this->getUpdatedAtColumn() => $this->fromDateTime($time), <ide> ]); <ide> } <ide> <ide><path>tests/Database/DatabaseSoftDeletingTraitTest.php <ide> public function testDeleteSetsSoftDeletedColumn() <ide> $query->shouldReceive('where')->once()->with('id', 1)->andReturn($query); <ide> $query->shouldReceive('update')->once()->with([ <ide> 'deleted_at' => 'date-time', <del> 'updated_at' => 'date-time' <add> 'updated_at' => 'date-time', <ide> ]); <ide> $model->delete(); <ide>
2
PHP
PHP
add csrf middleware to main app stack
c0019c6fcb552f533607a6737688a1bcdecb2873
<ide><path>app/Providers/AppServiceProvider.php <ide> class AppServiceProvider extends ServiceProvider { <ide> 'Illuminate\Session\Middleware\Reader', <ide> 'Illuminate\Session\Middleware\Writer', <ide> 'Illuminate\View\Middleware\ErrorBinder', <add> 'App\Http\Middleware\CsrfMiddleware', <ide> ]; <ide> <ide> /**
1
Javascript
Javascript
add a test case for resolve.fallback
b89b536106338a1862215687c8d404fb2df5121f
<ide><path>test/configCases/resolve/fallback/a/1.js <add>module.exports = 1; <ide><path>test/configCases/resolve/fallback/a/2.js <add>module.exports = 'not 2'; <ide><path>test/configCases/resolve/fallback/b/2.js <add>module.exports = 2; <ide><path>test/configCases/resolve/fallback/index.js <add>it("ignores the fallback if an existing module is present", () => { <add> const two = require("./b/2"); <add> expect(two).toBe(2); <add>}); <add> <add>it("can fallback if the module does not exist", () => { <add> const one = require("./b/1"); <add> expect(one).toBe(1); <add>}); <ide><path>test/configCases/resolve/fallback/webpack.config.js <add>const path = require("path"); <add>/** @type {import("../../../../").Configuration} */ <add>module.exports = { <add> resolve: { <add> fallback: { <add> "./b": path.resolve(__dirname, "a") <add> } <add> } <add>};
5
Ruby
Ruby
remove last uses of `@env[]` and `@env[]=`
e0b5a773ccb9c31a3fb76ba88813b6e41ca41466
<ide><path>actionpack/lib/action_dispatch/http/mime_negotiation.rb <ide> def use_accept_header <ide> end <ide> <ide> def format_from_path_extension <del> path = @env['action_dispatch.original_path'] || @env['PATH_INFO'] <add> path = get_header('action_dispatch.original_path') || get_header('PATH_INFO') <ide> if match = path && path.match(/\.(\w+)\z/) <ide> Mime[match.captures.first] <ide> end <ide><path>actionpack/lib/action_dispatch/testing/test_request.rb <ide> def self.default_env <ide> private_class_method :default_env <ide> <ide> def request_method=(method) <del> @env['REQUEST_METHOD'] = method.to_s.upcase <add> set_header('REQUEST_METHOD', method.to_s.upcase) <ide> end <ide> <ide> def host=(host) <del> @env['HTTP_HOST'] = host <add> set_header('HTTP_HOST', host) <ide> end <ide> <ide> def port=(number) <del> @env['SERVER_PORT'] = number.to_i <add> set_header('SERVER_PORT', number.to_i) <ide> end <ide> <ide> def request_uri=(uri) <del> @env['REQUEST_URI'] = uri <add> set_header('REQUEST_URI', uri) <ide> end <ide> <ide> def path=(path) <del> @env['PATH_INFO'] = path <add> set_header('PATH_INFO', path) <ide> end <ide> <ide> def action=(action_name) <ide> path_parameters[:action] = action_name.to_s <ide> end <ide> <ide> def if_modified_since=(last_modified) <del> @env['HTTP_IF_MODIFIED_SINCE'] = last_modified <add> set_header('HTTP_IF_MODIFIED_SINCE', last_modified) <ide> end <ide> <ide> def if_none_match=(etag) <del> @env['HTTP_IF_NONE_MATCH'] = etag <add> set_header('HTTP_IF_NONE_MATCH', etag) <ide> end <ide> <ide> def remote_addr=(addr) <del> @env['REMOTE_ADDR'] = addr <add> set_header('REMOTE_ADDR', addr) <ide> end <ide> <ide> def user_agent=(user_agent) <del> @env['HTTP_USER_AGENT'] = user_agent <add> set_header('HTTP_USER_AGENT', user_agent) <ide> end <ide> <ide> def accept=(mime_types) <del> @env.delete('action_dispatch.request.accepts') <del> @env['HTTP_ACCEPT'] = Array(mime_types).collect(&:to_s).join(",") <add> delete_header('action_dispatch.request.accepts') <add> set_header('HTTP_ACCEPT', Array(mime_types).collect(&:to_s).join(",")) <ide> end <ide> end <ide> end <ide><path>actionpack/test/dispatch/test_request_test.rb <ide> class TestRequestTest < ActiveSupport::TestCase <ide> assert_equal 'GoogleBot', req.user_agent <ide> end <ide> <add> test "setter methods" do <add> req = ActionDispatch::TestRequest.create({}) <add> get = 'GET' <add> <add> [ <add> 'request_method=', 'host=', 'request_uri=', 'path=', 'if_modified_since=', 'if_none_match=', <add> 'remote_addr=', 'user_agent=', 'accept=' <add> ].each do |method| <add> req.send(method, get) <add> end <add> <add> req.port = 8080 <add> req.accept = 'hello goodbye' <add> <add> assert_equal(get, req.get_header('REQUEST_METHOD')) <add> assert_equal(get, req.get_header('HTTP_HOST')) <add> assert_equal(8080, req.get_header('SERVER_PORT')) <add> assert_equal(get, req.get_header('REQUEST_URI')) <add> assert_equal(get, req.get_header('PATH_INFO')) <add> assert_equal(get, req.get_header('HTTP_IF_MODIFIED_SINCE')) <add> assert_equal(get, req.get_header('HTTP_IF_NONE_MATCH')) <add> assert_equal(get, req.get_header('REMOTE_ADDR')) <add> assert_equal(get, req.get_header('HTTP_USER_AGENT')) <add> assert_nil(req.get_header('action_dispatch.request.accepts')) <add> assert_equal('hello goodbye', req.get_header('HTTP_ACCEPT')) <add> end <add> <ide> private <ide> def assert_cookies(expected, cookie_jar) <ide> assert_equal(expected, cookie_jar.instance_variable_get("@cookies"))
3
PHP
PHP
add command factory support
7ebc6af1ed457b3f78447e5d305f00de4c70995a
<ide><path>src/Console/CommandFactory.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Console; <add> <add>use InvalidArgumentException; <add> <add>class CommandFactory implements CommandFactoryInterface <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> public function create($className, ConsoleIo $io) <add> { <add> if (is_subclass_of($className, Shell::class)) { <add> return new $className($io); <add> } <add> <add> // Command class <add> $command = new $className(); <add> if (!$command instanceof Command) { <add> $valid = implode('` or `', [Shell::class, Command::class]); <add> $message = sprintf('Class `%s` must be an instance of `%s`.', $className, $valid); <add> throw new InvalidArgumentException($message); <add> } <add> <add> return $command; <add> } <add>} <ide><path>src/Console/CommandFactoryInterface.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Console; <add> <add>/** <add> * An interface for abstracting creation of command and shell instances. <add> */ <add>interface CommandFactoryInterface <add>{ <add> /** <add> * The factory method for creating Command and Shell instances. <add> * <add> * @param string $className Command/Shell class name. <add> * @param \Cake\Console\ConsoleIo $io The IO wrapper for the created shell class. <add> * @return \Cake\Console\Shell|\Cake\Console\Command <add> */ <add> public function create($className, ConsoleIo $io); <add>} <ide><path>src/Console/CommandRunner.php <ide> class CommandRunner implements EventDispatcherInterface <ide> */ <ide> protected $app; <ide> <add> /** <add> * The application console commands are being run for. <add> * <add> * @var \Cake\Console\CommandFactoryInterface <add> */ <add> protected $factory; <add> <ide> /** <ide> * The root command name. Defaults to `cake`. <ide> * <ide> class CommandRunner implements EventDispatcherInterface <ide> * <ide> * @param \Cake\Core\ConsoleApplicationInterface $app The application to run CLI commands for. <ide> * @param string $root The root command name to be removed from argv. <add> * @param \Cake\Console\CommandFactoryInterface $factory Command factory instance. <ide> */ <del> public function __construct(ConsoleApplicationInterface $app, $root = 'cake') <add> public function __construct(ConsoleApplicationInterface $app, $root = 'cake', CommandFactoryInterface $factory = null) <ide> { <ide> $this->setApp($app); <ide> $this->root = $root; <add> $this->factory = $factory ?: new CommandFactory(); <ide> $this->aliases = [ <ide> '--version' => 'version', <ide> '--help' => 'help', <ide> protected function runShell(Shell $shell, array $argv) <ide> */ <ide> protected function createShell($className, ConsoleIo $io) <ide> { <del> if (is_subclass_of($className, Shell::class)) { <del> return new $className($io); <del> } <del> <del> // Command class <del> return new $className(); <add> return $this->factory->create($className, $io); <ide> } <ide> } <ide><path>tests/TestCase/Console/CommandFactoryTest.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Test\TestCase\Console; <add> <add>use Cake\Console\CommandFactory; <add>use Cake\Console\ConsoleIo; <add>use Cake\TestSuite\TestCase; <add>use InvalidArgumentException; <add>use TestApp\Command\DemoCommand; <add>use TestApp\Shell\SampleShell; <add> <add>class CommandFactoryTest extends TestCase <add>{ <add> public function testCreateCommand() <add> { <add> $factory = new CommandFactory(); <add> <add> $command = $factory->create(DemoCommand::class, new ConsoleIo()); <add> $this->assertInstanceOf(DemoCommand::class, $command); <add> } <add> <add> public function testCreateShell() <add> { <add> $factory = new CommandFactory(); <add> <add> $io = new ConsoleIo(); <add> $shell = $factory->create(SampleShell::class, $io); <add> <add> $this->assertInstanceOf(SampleShell::class, $shell); <add> $this->assertSame($io, $shell->getIo()); <add> } <add> <add> public function testInvalid() <add> { <add> $factory = new CommandFactory(); <add> <add> $this->expectException(InvalidArgumentException::class); <add> $this->expectExceptionMessage('Class `Cake\Test\TestCase\Console\CommandFactoryTest` must be an instance of `Cake\Console\Shell` or `Cake\Console\Command`.'); <add> <add> $factory->create(static::class, new ConsoleIo()); <add> } <add>} <ide><path>tests/TestCase/Console/CommandRunnerTest.php <ide> namespace Cake\Test\Console; <ide> <ide> use Cake\Console\CommandCollection; <add>use Cake\Console\CommandFactoryInterface; <ide> use Cake\Console\CommandRunner; <ide> use Cake\Console\ConsoleIo; <ide> use Cake\Console\Shell; <ide> public function testRunValidCommandClass() <ide> $this->assertContains('Demo Command!', $messages); <ide> } <ide> <add> /** <add> * Test using a custom factory <add> * <add> * @return void <add> */ <add> public function testRunWithCustomFactory() <add> { <add> $output = new ConsoleOutput(); <add> $io = $this->getMockIo($output); <add> $factory = $this->createMock(CommandFactoryInterface::class); <add> $factory->expects($this->once()) <add> ->method('create') <add> ->with(DemoCommand::class, $io) <add> ->willReturn(new DemoCommand()); <add> <add> $app = $this->makeAppWithCommands(['ex' => DemoCommand::class]); <add> <add> $runner = new CommandRunner($app, 'cake', $factory); <add> $result = $runner->run(['cake', 'ex'], $io); <add> $this->assertSame(Shell::CODE_SUCCESS, $result); <add> <add> $messages = implode("\n", $output->messages()); <add> $this->assertContains('Demo Command!', $messages); <add> } <add> <ide> /** <ide> * Test running a valid command <ide> *
5
PHP
PHP
remove most of the deprecated features in routing
09685ae4d50d7db30d726806fe8a3cc84f74aa94
<ide><path>src/Routing/Route/RedirectRoute.php <ide> */ <ide> class RedirectRoute extends Route <ide> { <del> <del> /** <del> * A Response object <del> * <del> * @var \Cake\Http\Response <del> * @deprecated 3.2.0 This property is unused. <del> */ <del> public $response; <del> <ide> /** <ide> * The location to redirect to. <ide> * <ide><path>src/Routing/Route/Route.php <ide> class Route <ide> public function __construct($template, $defaults = [], array $options = []) <ide> { <ide> $this->template = $template; <del> if (isset($defaults['[method]'])) { <del> deprecationWarning('The `[method]` option is deprecated. Use `_method` instead.'); <del> $defaults['_method'] = $defaults['[method]']; <del> unset($defaults['[method]']); <del> } <ide> $this->defaults = (array)$defaults; <ide> $this->options = $options + ['_ext' => [], '_middleware' => []]; <ide> $this->setExtensions((array)$this->options['_ext']); <ide> $this->setMiddleware((array)$this->options['_middleware']); <ide> unset($this->options['_middleware']); <ide> } <ide> <del> /** <del> * Get/Set the supported extensions for this route. <del> * <del> * @deprecated 3.3.9 Use getExtensions/setExtensions instead. <del> * @param null|string|array $extensions The extensions to set. Use null to get. <del> * @return array|null The extensions or null. <del> */ <del> public function extensions($extensions = null) <del> { <del> deprecationWarning( <del> 'Route::extensions() is deprecated. ' . <del> 'Use Route::setExtensions()/getExtensions() instead.' <del> ); <del> if ($extensions === null) { <del> return $this->_extensions; <del> } <del> $this->_extensions = (array)$extensions; <del> } <del> <ide> /** <ide> * Set the supported extensions for this route. <ide> * <ide> public function parseRequest(ServerRequestInterface $request) <ide> * @param string $url The URL to attempt to parse. <ide> * @param string $method The HTTP method of the request being parsed. <ide> * @return array|false An array of request parameters, or false on failure. <del> * @deprecated 3.4.0 Use/implement parseRequest() instead as it provides more flexibility/control. <ide> */ <del> public function parse($url, $method = '') <add> public function parse($url, $method) <ide> { <ide> if (empty($this->_compiledRoute)) { <ide> $this->compile(); <ide> public function parse($url, $method = '') <ide> return false; <ide> } <ide> <del> if (isset($this->defaults['_method'])) { <del> if (empty($method)) { <del> deprecationWarning( <del> 'Extracting the request method from global state when parsing routes is deprecated. ' . <del> 'Instead adopt Route::parseRequest() which extracts the method from the passed request.' <del> ); <del> // Deprecated reading the global state is deprecated and will be removed in 4.x <del> $request = Router::getRequest(true) ?: ServerRequestFactory::fromGlobals(); <del> $method = $request->getMethod(); <del> } <del> if (!in_array($method, (array)$this->defaults['_method'], true)) { <del> return false; <del> } <add> if (isset($this->defaults['_method']) && <add> !in_array($method, (array)$this->defaults['_method'], true) <add> ) { <add> return false; <ide> } <ide> <ide> array_shift($route); <ide> protected function _matchMethod($url) <ide> if (empty($this->defaults['_method'])) { <ide> return true; <ide> } <del> // @deprecated The `[method]` support should be removed in 4.0.0 <del> if (isset($url['[method]'])) { <del> deprecationWarning('The `[method]` key is deprecated. Use `_method` instead.'); <del> $url['_method'] = $url['[method]']; <del> } <ide> if (empty($url['_method'])) { <ide> return false; <ide> } <ide><path>src/Routing/RouteBuilder.php <ide> public function __construct(RouteCollection $collection, $path, array $params = <ide> } <ide> } <ide> <del> /** <del> * Get or set default route class. <del> * <del> * @deprecated 3.5.0 Use getRouteClass/setRouteClass instead. <del> * @param string|null $routeClass Class name. <del> * @return string|null <del> */ <del> public function routeClass($routeClass = null) <del> { <del> deprecationWarning( <del> 'RouteBuilder::routeClass() is deprecated. ' . <del> 'Use RouteBuilder::setRouteClass()/getRouteClass() instead.' <del> ); <del> if ($routeClass === null) { <del> return $this->getRouteClass(); <del> } <del> $this->setRouteClass($routeClass); <del> } <del> <ide> /** <ide> * Set default route class. <ide> * <ide> public function getRouteClass() <ide> return $this->_routeClass; <ide> } <ide> <del> /** <del> * Get or set the extensions in this route builder's scope. <del> * <del> * Future routes connected in through this builder will have the connected <del> * extensions applied. However, setting extensions does not modify existing routes. <del> * <del> * @deprecated 3.5.0 Use getExtensions/setExtensions instead. <del> * @param null|string|array $extensions Either the extensions to use or null. <del> * @return array|null <del> */ <del> public function extensions($extensions = null) <del> { <del> deprecationWarning( <del> 'RouteBuilder::extensions() is deprecated. ' . <del> 'Use RouteBuilder::setExtensions()/getExtensions() instead.' <del> ); <del> if ($extensions === null) { <del> return $this->getExtensions(); <del> } <del> $this->setExtensions($extensions); <del> } <del> <ide> /** <ide> * Set the extensions in this route builder's scope. <ide> * <ide><path>src/Routing/RouteCollection.php <ide> public function named() <ide> return $this->_named; <ide> } <ide> <del> /** <del> * Get/set the extensions that the route collection could handle. <del> * <del> * @param null|string|array $extensions Either the list of extensions to set, <del> * or null to get. <del> * @param bool $merge Whether to merge with or override existing extensions. <del> * Defaults to `true`. <del> * @return array The valid extensions. <del> * @deprecated 3.5.0 Use getExtensions()/setExtensions() instead. <del> */ <del> public function extensions($extensions = null, $merge = true) <del> { <del> deprecationWarning( <del> 'RouteCollection::extensions() is deprecated. ' . <del> 'Use RouteCollection::setExtensions()/getExtensions() instead.' <del> ); <del> if ($extensions !== null) { <del> $this->setExtensions((array)$extensions, $merge); <del> } <del> <del> return $this->getExtensions(); <del> } <del> <ide> /** <ide> * Get the extensions that can be handled. <ide> * <ide><path>src/Routing/Router.php <ide> public static function connect($route, $defaults = [], $options = []) <ide> }); <ide> } <ide> <del> /** <del> * Connects a new redirection Route in the router. <del> * <del> * Compatibility proxy to \Cake\Routing\RouteBuilder::redirect() in the `/` scope. <del> * <del> * @param string $route A string describing the template of the route <del> * @param array $url A URL to redirect to. Can be a string or a Cake array-based URL <del> * @param array $options An array matching the named elements in the route to regular expressions which that <del> * element should match. Also contains additional parameters such as which routed parameters should be <del> * shifted into the passed arguments. As well as supplying patterns for routing parameters. <del> * @return void <del> * @see \Cake\Routing\RouteBuilder::redirect() <del> * @deprecated 3.3.0 Use Router::scope() and RouteBuilder::redirect() instead. <del> */ <del> public static function redirect($route, $url, $options = []) <del> { <del> deprecationWarning( <del> 'Router::redirect() is deprecated. ' . <del> 'Use Router::scope() and RouteBuilder::redirect() instead.' <del> ); <del> if (is_string($url)) { <del> $url = ['redirect' => $url]; <del> } <del> if (!isset($options['routeClass'])) { <del> $options['routeClass'] = 'Cake\Routing\Route\RedirectRoute'; <del> } <del> static::connect($route, $url, $options); <del> } <del> <del> /** <del> * Generate REST resource routes for the given controller(s). <del> * <del> * Compatibility proxy to \Cake\Routing\RouteBuilder::resources(). Additional, compatibility <del> * around prefixes and plugins and prefixes is handled by this method. <del> * <del> * A quick way to generate a default routes to a set of REST resources (controller(s)). <del> * <del> * ### Usage <del> * <del> * Connect resource routes for an app controller: <del> * <del> * ``` <del> * Router::mapResources('Posts'); <del> * ``` <del> * <del> * Connect resource routes for the Comment controller in the <del> * Comments plugin: <del> * <del> * ``` <del> * Router::mapResources('Comments.Comment'); <del> * ``` <del> * <del> * Plugins will create lower_case underscored resource routes. e.g <del> * `/comments/comment` <del> * <del> * Connect resource routes for the Posts controller in the <del> * Admin prefix: <del> * <del> * ``` <del> * Router::mapResources('Posts', ['prefix' => 'admin']); <del> * ``` <del> * <del> * Prefixes will create lower_case underscored resource routes. e.g <del> * `/admin/posts` <del> * <del> * ### Options: <del> * <del> * - 'id' - The regular expression fragment to use when matching IDs. By default, matches <del> * integer values and UUIDs. <del> * - 'prefix' - Routing prefix to use for the generated routes. Defaults to ''. <del> * Using this option will create prefixed routes, similar to using Routing.prefixes. <del> * - 'only' - Only connect the specific list of actions. <del> * - 'actions' - Override the method names used for connecting actions. <del> * - 'map' - Additional resource routes that should be connected. If you define 'only' and 'map', <del> * make sure that your mapped methods are also in the 'only' list. <del> * - 'path' - Change the path so it doesn't match the resource name. E.g ArticlesController <del> * is available at `/posts` <del> * <del> * @param string|array $controller A controller name or array of controller names (i.e. "Posts" or "ListItems") <del> * @param array $options Options to use when generating REST routes <del> * @see \Cake\Routing\RouteBuilder::resources() <del> * @deprecated 3.3.0 Use Router::scope() and RouteBuilder::resources() instead. <del> * @return void <del> */ <del> public static function mapResources($controller, $options = []) <del> { <del> deprecationWarning( <del> 'Router::mapResources() is deprecated. ' . <del> 'Use Router::scope() and RouteBuilder::resources() instead.' <del> ); <del> foreach ((array)$controller as $name) { <del> list($plugin, $name) = pluginSplit($name); <del> <del> $prefix = $pluginUrl = false; <del> if (!empty($options['prefix'])) { <del> $prefix = $options['prefix']; <del> unset($options['prefix']); <del> } <del> if ($plugin) { <del> $pluginUrl = Inflector::underscore($plugin); <del> } <del> <del> $callback = function ($routes) use ($name, $options) { <del> $routes->resources($name, $options); <del> }; <del> <del> if ($plugin && $prefix) { <del> $path = '/' . implode('/', [$prefix, $pluginUrl]); <del> $params = ['prefix' => $prefix, 'plugin' => $plugin]; <del> static::scope($path, $params, $callback); <del> <del> return; <del> } <del> <del> if ($prefix) { <del> static::prefix($prefix, $callback); <del> <del> return; <del> } <del> <del> if ($plugin) { <del> static::plugin($plugin, $callback); <del> <del> return; <del> } <del> <del> static::scope('/', $callback); <del> <del> return; <del> } <del> } <del> <del> /** <del> * Parses given URL string. Returns 'routing' parameters for that URL. <del> * <del> * @param string $url URL to be parsed. <del> * @param string $method The HTTP method being used. <del> * @return array Parsed elements from URL. <del> * @throws \Cake\Routing\Exception\MissingRouteException When a route cannot be handled <del> * @deprecated 3.4.0 Use Router::parseRequest() instead. <del> */ <del> public static function parse($url, $method = '') <del> { <del> deprecationWarning( <del> 'Router::parse() is deprecated. ' . <del> 'Use Router::parseRequest() instead. This will require adopting the Http\Server library.' <del> ); <del> if (!static::$initialized) { <del> static::_loadRoutes(); <del> } <del> if (strpos($url, '/') !== 0) { <del> $url = '/' . $url; <del> } <del> <del> return static::$_collection->parse($url, $method); <del> } <del> <ide> /** <ide> * Get the routing parameters for the request is possible. <ide> * <ide> public static function parseRequest(ServerRequestInterface $request) <ide> * Will accept either a Cake\Http\ServerRequest object or an array of arrays. Support for <ide> * accepting arrays may be removed in the future. <ide> * <del> * @param \Cake\Http\ServerRequest|array $request Parameters and path information or a Cake\Http\ServerRequest object. <add> * @param \Psr\Http\Message\ServerRequestInterface $request request object. <ide> * @return void <del> * @deprecatd 3.6.0 Support for arrays will be removed in 4.0.0 <ide> */ <del> public static function setRequestInfo($request) <add> public static function setRequestInfo(ServerRequestInterface $request) <ide> { <del> if ($request instanceof ServerRequest) { <del> static::pushRequest($request); <del> } else { <del> deprecationWarning( <del> 'Passing an array into Router::setRequestInfo() is deprecated. ' . <del> 'Pass an instance of ServerRequest instead.' <del> ); <del> <del> $requestData = $request; <del> $requestData += [[], []]; <del> $requestData[0] += [ <del> 'controller' => false, <del> 'action' => false, <del> 'plugin' => null <del> ]; <del> $request = new ServerRequest([ <del> 'params' => $requestData[0], <del> 'url' => isset($requestData[1]['here']) ? $requestData[1]['here'] : '/', <del> 'base' => isset($requestData[1]['base']) ? $requestData[1]['base'] : '', <del> 'webroot' => isset($requestData[1]['webroot']) ? $requestData[1]['webroot'] : '/', <del> ]); <del> static::pushRequest($request); <del> } <add> static::pushRequest($request); <ide> } <ide> <ide> /** <ide> public static function setRequestContext(ServerRequestInterface $request) <ide> * <ide> * @return \Cake\Http\ServerRequest The request removed from the stack. <ide> * @see \Cake\Routing\Router::pushRequest() <del> * @see \Cake\Routing\RequestActionTrait::requestAction() <ide> */ <ide> public static function popRequest() <ide> { <ide> public static function extensions($extensions = null, $merge = true) <ide> return static::$_defaultExtensions = $extensions; <ide> } <ide> <del> /** <del> * Provides legacy support for named parameters on incoming URLs. <del> * <del> * Checks the passed parameters for elements containing `$options['separator']` <del> * Those parameters are split and parsed as if they were old style named parameters. <del> * <del> * The parsed parameters will be moved from params['pass'] to params['named']. <del> * <del> * ### Options <del> * <del> * - `separator` The string to use as a separator. Defaults to `:`. <del> * <del> * @param \Cake\Http\ServerRequest $request The request object to modify. <del> * @param array $options The array of options. <del> * @return \Cake\Http\ServerRequest The modified request <del> * @deprecated 3.3.0 Named parameter backwards compatibility will be removed in 4.0. <del> */ <del> public static function parseNamedParams(ServerRequest $request, array $options = []) <del> { <del> deprecationWarning( <del> 'Router::parseNamedParams() is deprecated. ' . <del> '2.x backwards compatible named parameter support will be removed in 4.0' <del> ); <del> $options += ['separator' => ':']; <del> if (!$request->getParam('pass')) { <del> return $request->withParam('named', []); <del> } <del> $named = []; <del> $pass = $request->getParam('pass'); <del> foreach ((array)$pass as $key => $value) { <del> if (strpos($value, $options['separator']) === false) { <del> continue; <del> } <del> unset($pass[$key]); <del> list($key, $value) = explode($options['separator'], $value, 2); <del> <del> if (preg_match_all('/\[([A-Za-z0-9_-]+)?\]/', $key, $matches, PREG_SET_ORDER)) { <del> $matches = array_reverse($matches); <del> $parts = explode('[', $key); <del> $key = array_shift($parts); <del> $arr = $value; <del> foreach ($matches as $match) { <del> if (empty($match[1])) { <del> $arr = [$arr]; <del> } else { <del> $arr = [ <del> $match[1] => $arr <del> ]; <del> } <del> } <del> $value = $arr; <del> } <del> $named = array_merge_recursive($named, [$key => $value]); <del> } <del> <del> return $request <del> ->withParam('pass', $pass) <del> ->withParam('named', $named); <del> } <del> <ide> /** <ide> * Create a RouteBuilder for the provided path. <ide> * <ide> public static function routes() <ide> return static::$_collection->routes(); <ide> } <ide> <add> /** <add> * Loads route configuration <add> * <add> * @deprecated 3.5.0 Routes will be loaded via the Application::routes() hook in 4.0.0 <add> * @return void <add> */ <add> protected static function _loadRoutes() <add> { <add> static::$initialized = true; <add> include CONFIG . 'routes.php'; <add> } <add> <ide> /** <ide> * Get the RouteCollection inside the Router <ide> * <ide> public static function setRouteCollection($routeCollection) <ide> static::$_collection = $routeCollection; <ide> static::$initialized = true; <ide> } <del> <del> /** <del> * Loads route configuration <del> * <del> * @deprecated 3.5.0 Routes will be loaded via the Application::routes() hook in 4.0.0 <del> * @return void <del> */ <del> protected static function _loadRoutes() <del> { <del> static::$initialized = true; <del> include CONFIG . 'routes.php'; <del> } <ide> } <ide><path>tests/TestCase/Routing/Route/RouteTest.php <ide> public function testNoMatchParseExtension($url, array $ext) <ide> $this->assertNull($outExt); <ide> } <ide> <del> /** <del> * Expects extensions to be set <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testExtensions() <del> { <del> $this->deprecated(function () { <del> $route = new RouteProtected('/:controller/:action/*', []); <del> $this->assertEquals([], $route->extensions()); <del> $route->extensions(['xml']); <del> <del> $this->assertEquals(['xml'], $route->extensions()); <del> }); <del> } <del> <ide> /** <ide> * Expects extensions to be set <ide> * <ide> public function testParseWithMultipleHttpMethodConditions() <ide> $this->assertEquals($expected, $route->parse('/sample', 'POST')); <ide> } <ide> <del> /** <del> * Test deprecated globals reading for method matching <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testParseWithMultipleHttpMethodDeprecated() <del> { <del> $this->deprecated(function () { <del> $_SERVER['REQUEST_METHOD'] = 'GET'; <del> $route = new Route('/sample', [ <del> 'controller' => 'posts', <del> 'action' => 'index', <del> '_method' => ['PUT', 'POST'] <del> ]); <del> $this->assertFalse($route->parse('/sample')); <del> <del> $_SERVER['REQUEST_METHOD'] = 'POST'; <del> $expected = [ <del> 'controller' => 'posts', <del> 'action' => 'index', <del> 'pass' => [], <del> '_method' => ['PUT', 'POST'], <del> '_matchedRoute' => '/sample' <del> ]; <del> $this->assertEquals($expected, $route->parse('/sample')); <del> }); <del> } <del> <ide> /** <ide> * Test that http header conditions can work with URL generation <ide> * <ide> public function testMatchWithMultipleHttpMethodConditions() <ide> $this->assertEquals('/sample', $route->match($url)); <ide> } <ide> <del> /** <del> * Check [method] compatibility. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testMethodCompatibility() <del> { <del> $this->deprecated(function () { <del> $_SERVER['REQUEST_METHOD'] = 'POST'; <del> $route = new Route('/sample', [ <del> 'controller' => 'Articles', <del> 'action' => 'index', <del> '[method]' => 'POST', <del> ]); <del> $url = [ <del> 'controller' => 'Articles', <del> 'action' => 'index', <del> '_method' => 'POST', <del> ]; <del> $this->assertEquals('/sample', $route->match($url)); <del> <del> $url = [ <del> 'controller' => 'Articles', <del> 'action' => 'index', <del> '[method]' => 'POST', <del> ]; <del> $this->assertEquals('/sample', $route->match($url)); <del> }); <del> } <del> <ide> /** <ide> * Test that patterns work for :action <ide> * <ide> public function testSetPatterns() <ide> $this->assertSame('[a-z]+', $route->options['id']); <ide> $this->assertArrayNotHasKey('multibytePattern', $route->options); <ide> <del> $this->assertFalse($route->parse('/reviews/a-b-c/xyz')); <del> $this->assertNotEmpty($route->parse('/reviews/2016-05-12/xyz')); <add> $this->assertFalse($route->parse('/reviews/a-b-c/xyz', 'GET')); <add> $this->assertNotEmpty($route->parse('/reviews/2016-05-12/xyz', 'GET')); <ide> } <ide> <ide> /** <ide> public function testSetPatternsMultibyte() <ide> ]); <ide> $this->assertArrayHasKey('multibytePattern', $route->options); <ide> <del> $this->assertNotEmpty($route->parse('/reviews/abcs/bla-blan-тест')); <add> $this->assertNotEmpty($route->parse('/reviews/abcs/bla-blan-тест', 'GET')); <ide> } <ide> <ide> /** <ide><path>tests/TestCase/Routing/RouteBuilderTest.php <ide> public function testResourcesInScope() <ide> $this->assertEquals('/api/articles/99.json', $url); <ide> } <ide> <del> /** <del> * Test resource parsing. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testResourcesParsingReadGlobals() <del> { <del> $this->deprecated(function () { <del> $routes = new RouteBuilder($this->collection, '/'); <del> $routes->resources('Articles'); <del> <del> $_SERVER['REQUEST_METHOD'] = 'GET'; <del> $result = $this->collection->parse('/articles'); <del> $this->assertEquals('Articles', $result['controller']); <del> $this->assertEquals('index', $result['action']); <del> $this->assertEquals([], $result['pass']); <del> <del> $_SERVER['REQUEST_METHOD'] = 'POST'; <del> $result = $this->collection->parse('/articles'); <del> $this->assertEquals('Articles', $result['controller']); <del> $this->assertEquals('add', $result['action']); <del> $this->assertEquals([], $result['pass']); <del> }); <del> } <del> <ide> /** <ide> * Test resource parsing. <ide> * <ide> public function testLoadPlugin() <ide> $this->assertCount(1, $this->collection->routes()); <ide> $this->assertNotEmpty($this->collection->parse('/test_plugin', 'GET')); <ide> } <del> <del> /** <del> * Test routeClass() still works. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testRouteClassBackwardCompat() <del> { <del> $this->deprecated(function () { <del> $routes = new RouteBuilder($this->collection, '/l'); <del> $this->assertNull($routes->routeClass('TestApp\Routing\Route\DashedRoute')); <del> $this->assertSame('TestApp\Routing\Route\DashedRoute', $routes->routeClass()); <del> $this->assertSame('TestApp\Routing\Route\DashedRoute', $routes->getRouteClass()); <del> }); <del> } <del> <del> /** <del> * Test extensions() still works. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testExtensionsBackwardCompat() <del> { <del> $this->deprecated(function () { <del> $routes = new RouteBuilder($this->collection, '/l'); <del> $this->assertNull($routes->extensions(['html'])); <del> $this->assertSame(['html'], $routes->extensions()); <del> $this->assertSame(['html'], $routes->getExtensions()); <del> <del> $this->assertNull($routes->extensions('json')); <del> $this->assertSame(['json'], $routes->extensions()); <del> $this->assertSame(['json'], $routes->getExtensions()); <del> }); <del> } <ide> } <ide><path>tests/TestCase/Routing/RouteCollectionTest.php <ide> public function testAddingDuplicateNamedRoutes() <ide> $this->collection->add($two, ['_name' => 'test']); <ide> } <ide> <del> /** <del> * Test combined get/set method. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testExtensions() <del> { <del> $this->deprecated(function () { <del> $this->assertEquals([], $this->collection->extensions()); <del> <del> $this->collection->extensions('json'); <del> $this->assertEquals(['json'], $this->collection->extensions()); <del> <del> $this->collection->extensions(['rss', 'xml']); <del> $this->assertEquals(['json', 'rss', 'xml'], $this->collection->extensions()); <del> <del> $this->collection->extensions(['csv'], false); <del> $this->assertEquals(['csv'], $this->collection->extensions()); <del> }); <del> } <del> <ide> /** <ide> * Test basic setExtension and its getter. <ide> * <ide><path>tests/TestCase/Routing/RouterTest.php <ide> public function testRouteExists() <ide> $this->assertFalse(Router::routeExists(['action' => 'view', 'controller' => 'users', 'plugin' => 'test'])); <ide> } <ide> <del> /** <del> * testMapResources method <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testMapResources() <del> { <del> $this->deprecated(function () { <del> Router::mapResources('Posts'); <del> <del> $expected = [ <del> 'pass' => [], <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'index', <del> '_method' => 'GET', <del> '_matchedRoute' => '/posts', <del> ]; <del> $result = Router::parse('/posts', 'GET'); <del> $this->assertEquals($expected, $result); <del> <del> $expected = [ <del> 'pass' => ['13'], <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'view', <del> 'id' => '13', <del> '_method' => 'GET', <del> '_matchedRoute' => '/posts/:id', <del> ]; <del> $result = Router::parse('/posts/13', 'GET'); <del> $this->assertEquals($expected, $result); <del> <del> $expected = [ <del> 'pass' => [], <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'add', <del> '_method' => 'POST', <del> '_matchedRoute' => '/posts', <del> ]; <del> $result = Router::parse('/posts', 'POST'); <del> $this->assertEquals($expected, $result); <del> <del> $expected = [ <del> 'pass' => ['13'], <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'edit', <del> 'id' => '13', <del> '_method' => ['PUT', 'PATCH'], <del> '_matchedRoute' => '/posts/:id', <del> ]; <del> $result = Router::parse('/posts/13', 'PUT'); <del> $this->assertEquals($expected, $result); <del> <del> $expected = [ <del> 'pass' => ['475acc39-a328-44d3-95fb-015000000000'], <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'edit', <del> 'id' => '475acc39-a328-44d3-95fb-015000000000', <del> '_method' => ['PUT', 'PATCH'], <del> '_matchedRoute' => '/posts/:id', <del> ]; <del> $result = Router::parse('/posts/475acc39-a328-44d3-95fb-015000000000', 'PUT'); <del> $this->assertEquals($expected, $result); <del> <del> $expected = [ <del> 'pass' => ['13'], <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'delete', <del> 'id' => '13', <del> '_method' => 'DELETE', <del> '_matchedRoute' => '/posts/:id', <del> ]; <del> $result = Router::parse('/posts/13', 'DELETE'); <del> $this->assertEquals($expected, $result); <del> <del> Router::reload(); <del> Router::mapResources('Posts', ['id' => '[a-z0-9_]+']); <del> <del> $expected = [ <del> 'pass' => ['add'], <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'view', <del> 'id' => 'add', <del> '_method' => 'GET', <del> '_matchedRoute' => '/posts/:id', <del> ]; <del> $result = Router::parse('/posts/add', 'GET'); <del> $this->assertEquals($expected, $result); <del> <del> $expected = [ <del> 'pass' => ['name'], <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'edit', <del> 'id' => 'name', <del> '_method' => ['PUT', 'PATCH'], <del> '_matchedRoute' => '/posts/:id', <del> ]; <del> $result = Router::parse('/posts/name', 'PUT'); <del> $this->assertEquals($expected, $result); <del> }); <del> } <del> <del> /** <del> * testMapResources with plugin controllers. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testPluginMapResources() <del> { <del> $this->deprecated(function () { <del> Router::mapResources('TestPlugin.TestPlugin'); <del> <del> $result = Router::parse('/test_plugin/test_plugin', 'GET'); <del> $expected = [ <del> 'pass' => [], <del> 'plugin' => 'TestPlugin', <del> 'controller' => 'TestPlugin', <del> 'action' => 'index', <del> '_method' => 'GET', <del> '_matchedRoute' => '/test_plugin/test_plugin', <del> ]; <del> $this->assertEquals($expected, $result); <del> <del> $result = Router::parse('/test_plugin/test_plugin/13', 'GET'); <del> $expected = [ <del> 'pass' => ['13'], <del> 'plugin' => 'TestPlugin', <del> 'controller' => 'TestPlugin', <del> 'action' => 'view', <del> 'id' => '13', <del> '_method' => 'GET', <del> '_matchedRoute' => '/test_plugin/test_plugin/:id', <del> ]; <del> $this->assertEquals($expected, $result); <del> }); <del> } <del> <del> /** <del> * Test mapResources with a prefix. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testMapResourcesWithPrefix() <del> { <del> $this->deprecated(function () { <del> Router::mapResources('Posts', ['prefix' => 'api']); <del> <del> $result = Router::parse('/api/posts', 'GET'); <del> <del> $expected = [ <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'index', <del> 'pass' => [], <del> 'prefix' => 'api', <del> '_method' => 'GET', <del> '_matchedRoute' => '/api/posts', <del> ]; <del> $this->assertEquals($expected, $result); <del> }); <del> } <del> <del> /** <del> * Test mapResources with a default extension. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testMapResourcesWithExtension() <del> { <del> $this->deprecated(function () { <del> Router::extensions(['json', 'xml'], false); <del> Router::mapResources('Posts', ['_ext' => 'json']); <del> <del> $expected = [ <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'index', <del> 'pass' => [], <del> '_method' => 'GET', <del> '_matchedRoute' => '/posts', <del> ]; <del> <del> $result = Router::parse('/posts', 'GET'); <del> $this->assertEquals($expected, $result); <del> <del> $result = Router::parse('/posts.json', 'GET'); <del> $expected['_ext'] = 'json'; <del> $this->assertEquals($expected, $result); <del> <del> $result = Router::parse('/posts.xml', 'GET'); <del> $this->assertArrayNotHasKey('_method', $result, 'Not an extension/resource route.'); <del> }); <del> } <del> <del> /** <del> * testMapResources with custom connectOptions <del> * <del> * @group deprecated <del> */ <del> public function testMapResourcesConnectOptions() <del> { <del> $this->deprecated(function () { <del> Plugin::load('TestPlugin'); <del> Router::mapResources('Posts', [ <del> 'connectOptions' => [ <del> 'routeClass' => 'TestPlugin.TestRoute', <del> 'foo' => '^(bar)$', <del> ], <del> ]); <del> $routes = Router::routes(); <del> $route = $routes[0]; <del> $this->assertInstanceOf('TestPlugin\Routing\Route\TestRoute', $route); <del> $this->assertEquals('^(bar)$', $route->options['foo']); <del> }); <del> } <del> <del> /** <del> * Test mapResources with a plugin and prefix. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testPluginMapResourcesWithPrefix() <del> { <del> $this->deprecated(function () { <del> Router::mapResources('TestPlugin.TestPlugin', ['prefix' => 'api']); <del> <del> $result = Router::parse('/api/test_plugin/test_plugin', 'GET'); <del> $expected = [ <del> 'pass' => [], <del> 'plugin' => 'TestPlugin', <del> 'controller' => 'TestPlugin', <del> 'prefix' => 'api', <del> 'action' => 'index', <del> '_method' => 'GET', <del> '_matchedRoute' => '/api/test_plugin/test_plugin', <del> ]; <del> $this->assertEquals($expected, $result); <del> <del> $resources = Router::mapResources('Posts', ['prefix' => 'api']); <del> <del> $result = Router::parse('/api/posts', 'GET'); <del> $expected = [ <del> 'pass' => [], <del> 'plugin' => null, <del> 'controller' => 'Posts', <del> 'action' => 'index', <del> '_method' => 'GET', <del> 'prefix' => 'api', <del> '_matchedRoute' => '/api/posts', <del> ]; <del> $this->assertEquals($expected, $result); <del> }); <del> } <del> <ide> /** <ide> * testMultipleResourceRoute method <ide> * <ide> public function testMultipleResourceRoute() <ide> /** <ide> * testGenerateUrlResourceRoute method <ide> * <del> * @group deprecated <ide> * @return void <ide> */ <ide> public function testGenerateUrlResourceRoute() <ide> { <del> $this->deprecated(function () { <del> Router::mapResources('Posts'); <add> Router::scope('/', function ($routes) { <add> $routes->resources('Posts'); <add> }); <ide> <del> $result = Router::url([ <del> 'controller' => 'Posts', <del> 'action' => 'index', <del> '_method' => 'GET' <del> ]); <del> $expected = '/posts'; <del> $this->assertEquals($expected, $result); <add> $result = Router::url([ <add> 'controller' => 'Posts', <add> 'action' => 'index', <add> '_method' => 'GET' <add> ]); <add> $expected = '/posts'; <add> $this->assertEquals($expected, $result); <ide> <del> $result = Router::url([ <del> 'controller' => 'Posts', <del> 'action' => 'view', <del> '_method' => 'GET', <del> 'id' => 10 <del> ]); <del> $expected = '/posts/10'; <del> $this->assertEquals($expected, $result); <del> <del> $result = Router::url(['controller' => 'Posts', 'action' => 'add', '_method' => 'POST']); <del> $expected = '/posts'; <del> $this->assertEquals($expected, $result); <del> <del> $result = Router::url(['controller' => 'Posts', 'action' => 'edit', '_method' => 'PUT', 'id' => 10]); <del> $expected = '/posts/10'; <del> $this->assertEquals($expected, $result); <del> <del> $result = Router::url(['controller' => 'Posts', 'action' => 'delete', '_method' => 'DELETE', 'id' => 10]); <del> $expected = '/posts/10'; <del> $this->assertEquals($expected, $result); <del> <del> $result = Router::url(['controller' => 'Posts', 'action' => 'edit', '_method' => 'PATCH', 'id' => 10]); <del> $expected = '/posts/10'; <del> $this->assertEquals($expected, $result); <del> }); <add> $result = Router::url([ <add> 'controller' => 'Posts', <add> 'action' => 'view', <add> '_method' => 'GET', <add> 'id' => 10 <add> ]); <add> $expected = '/posts/10'; <add> $this->assertEquals($expected, $result); <add> <add> $result = Router::url(['controller' => 'Posts', 'action' => 'add', '_method' => 'POST']); <add> $expected = '/posts'; <add> $this->assertEquals($expected, $result); <add> <add> $result = Router::url(['controller' => 'Posts', 'action' => 'edit', '_method' => 'PUT', 'id' => 10]); <add> $expected = '/posts/10'; <add> $this->assertEquals($expected, $result); <add> <add> $result = Router::url(['controller' => 'Posts', 'action' => 'delete', '_method' => 'DELETE', 'id' => 10]); <add> $expected = '/posts/10'; <add> $this->assertEquals($expected, $result); <add> <add> $result = Router::url(['controller' => 'Posts', 'action' => 'edit', '_method' => 'PATCH', 'id' => 10]); <add> $expected = '/posts/10'; <add> $this->assertEquals($expected, $result); <ide> } <ide> <ide> /** <ide> public function testParseError() <ide> Router::parseRequest($this->makeRequest('/nope', 'GET')); <ide> } <ide> <del> /** <del> * Test deprecated behavior <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testParseMethodCondition() <del> { <del> $this->deprecated(function () { <del> Router::connect('/posts', ['controller' => 'Posts', '_method' => 'POST']); <del> <del> $_SERVER['REQUEST_METHOD'] = 'POST'; <del> $this->assertNotEmpty(Router::parse('/posts')); <del> }); <del> } <del> <ide> /** <ide> * Test parse and reverse symmetry <ide> * <ide> public function testRegexRouteMatching() <ide> $this->assertEquals($expected, $result); <ide> } <ide> <del> /** <del> * testRegexRouteMatching error <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testRegexRouteMatchingError() <del> { <del> $this->expectException(\Cake\Routing\Exception\MissingRouteException::class); <del> $this->deprecated(function () { <del> Router::connect('/:locale/:controller/:action/*', [], ['locale' => 'dan|eng']); <del> Router::parse('/badness/test/test_action', 'GET'); <del> }); <del> } <del> <ide> /** <ide> * testRegexRouteMatching method <ide> * <ide> public function testReverseToArrayRequestQuery() <ide> $this->assertEquals($expected, $actual); <ide> } <ide> <del> /** <del> * test that setRequestInfo can accept arrays and turn that into a Request object. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testSetRequestInfoLegacy() <del> { <del> $this->deprecated(function () { <del> Router::setRequestInfo([ <del> [ <del> 'plugin' => null, 'controller' => 'images', 'action' => 'index', <del> 'url' => ['url' => 'protected/images/index'] <del> ], <del> [ <del> 'base' => '', <del> 'here' => '/protected/images/index', <del> 'webroot' => '/', <del> ] <del> ]); <del> $result = Router::getRequest(); <del> $this->assertEquals('images', $result->getParam('controller')); <del> $this->assertEquals('index', $result->getParam('action')); <del> <del> $this->assertEquals('', $result->getAttribute('base')); <del> $this->assertEquals('', $result->base); <del> <del> $this->assertEquals('/protected/images/index', $result->getRequestTarget()); <del> $this->assertEquals('/protected/images/index', $result->here); <del> <del> $this->assertEquals('/', $result->getAttribute('webroot')); <del> $this->assertEquals('/', $result->webroot); <del> }); <del> } <del> <ide> /** <ide> * test get request. <ide> * <ide> public function testPatternOnAction() <ide> $this->assertFalse($result); <ide> } <ide> <del> /** <del> * Test that redirect() works. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testRedirect() <del> { <del> $this->deprecated(function () { <del> Router::redirect('/mobile', '/', ['status' => 301]); <del> $routes = Router::routes(); <del> $route = $routes[0]; <del> $this->assertInstanceOf('Cake\Routing\Route\RedirectRoute', $route); <del> }); <del> } <del> <del> /** <del> * Test that redirect() works with another route class. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testRedirectWithAnotherRouteClass() <del> { <del> $this->deprecated(function () { <del> $route1 = $this->getMockBuilder('Cake\Routing\Route\RedirectRoute') <del> ->setConstructorArgs(['/mobile\'']) <del> ->setMethods(['parse']) <del> ->getMock(); <del> $class = '\\' . get_class($route1); <del> <del> Router::redirect('/mobile', '/', [ <del> 'status' => 301, <del> 'routeClass' => $class <del> ]); <del> <del> $routes = Router::routes(); <del> $route = $routes[0]; <del> $this->assertInstanceOf($class, $route); <del> }); <del> } <del> <del> /** <del> * Test that the compatibility method for incoming urls works. <del> * <del> * @group deprecated <del> * @return void <del> */ <del> public function testParseNamedParameters() <del> { <del> $this->deprecated(function () { <del> $request = new ServerRequest(); <del> $request->addParams([ <del> 'controller' => 'posts', <del> 'action' => 'index', <del> ]); <del> $result = Router::parseNamedParams($request); <del> $this->assertSame([], $result->params['named']); <del> <del> $request = new ServerRequest(); <del> $request->addParams([ <del> 'controller' => 'posts', <del> 'action' => 'index', <del> 'pass' => ['home', 'one:two', 'three:four', 'five[nested][0]:six', 'five[nested][1]:seven'] <del> ]); <del> $request = Router::parseNamedParams($request); <del> $expected = [ <del> 'plugin' => null, <del> 'controller' => 'posts', <del> 'action' => 'index', <del> '_ext' => null, <del> 'pass' => ['home'], <del> 'named' => [ <del> 'one' => 'two', <del> 'three' => 'four', <del> 'five' => [ <del> 'nested' => ['six', 'seven'] <del> ] <del> ] <del> ]; <del> $this->assertEquals($expected, $request->params); <del> }); <del> } <del> <ide> /** <ide> * Test the scope() method <ide> *
9
Text
Text
clarify prerequisites in benchmark/readme.md
dbd5dc932d56389aa494fda6f87b2e8f52bd97b4
<ide><path>benchmark/README.md <ide> io.js APIs. <ide> <ide> ## Prerequisites <ide> <del>Most of the http benchmarks require [`wrk`][wrk] and [`ab`][ab] being installed. <del>These are most often available through your preferred package manager. <add>Most of the http benchmarks require [`wrk`][wrk] and [`ab`][ab] (ApacheBench) being installed. <add>These may be available through your preferred package manager. <add> <add>If they are not available: <add>- `wrk` may easily built [from source](https://github.com/wg/wrk) via `make`. <add>- `ab` is sometimes bundled in a package called `apache2-utils`. <ide> <ide> [wrk]: https://github.com/wg/wrk <ide> [ab]: http://httpd.apache.org/docs/2.2/programs/ab.html
1
Javascript
Javascript
remove blank line
2c80b091225340ebb080490fa94293a3f1186bb9
<ide><path>tests/test-scale-linear.js <ide> console.log("domain unclamping:") <ide> console.log(" under -> ", x(-1)); <ide> console.log(" over -> ", x(11)); <ide> console.log(""); <del>
1
PHP
PHP
dump() and dd() with global scopes
5aa0c3abb3affeef1d8e5736da147b411892842c
<ide><path>src/Illuminate/Database/Eloquent/Builder.php <ide> class Builder <ide> * @var array <ide> */ <ide> protected $passthru = [ <del> 'insert', 'insertGetId', 'getBindings', 'toSql', <add> 'insert', 'insertGetId', 'getBindings', 'toSql', 'dump', 'dd', <ide> 'exists', 'doesntExist', 'count', 'min', 'max', 'avg', 'average', 'sum', 'getConnection', <ide> ]; <ide>
1