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
Ruby
Ruby
tell developers to submit odeprecated prs
17c24d040bc2a488b9bd70546cf0ef4f6d81d3bc
<ide><path>Library/Homebrew/utils.rb <ide> def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call <ide> <ide> if ARGV.homebrew_developer? || disable || <ide> Homebrew.raise_deprecation_exceptions? <del> raise MethodDeprecatedError, message <add> developer_message = message + "Or, even better, submit a PR to fix it!" <add> raise MethodDeprecatedError, developer_message <ide> elsif !Homebrew.auditing? <ide> opoo "#{message}\n" <ide> end
1
Javascript
Javascript
fix hmr on windows
c61100d0ceb4b71c86f01f35d7464d2d8a02b342
<ide><path>babel-preset/configs/hmr.js <ide> module.exports = function(options, filename) { <ide> var transform = filename <ide> ? './' + path.relative(path.dirname(filename), transformPath) // packager can't handle absolute paths <ide> : hmrTransform; <add> <add> // Fix the module path to use '/' on Windows. <add> if (path.sep === '\\') { <add> transform = transform.replace(/\\/g, '/'); <add> } <add> <ide> return { <ide> plugins: resolvePlugins([ <ide> [ <ide><path>packager/react-packager/src/Bundler/index.js <ide> class Bundler { <ide> ); <ide> } <ide> <del> _hmrURL(prefix, platform, extensionOverride, path) { <del> const matchingRoot = this._projectRoots.find(root => path.startsWith(root)); <add> _hmrURL(prefix, platform, extensionOverride, filePath) { <add> const matchingRoot = this._projectRoots.find(root => filePath.startsWith(root)); <ide> <ide> if (!matchingRoot) { <del> throw new Error('No matching project root for ', path); <add> throw new Error('No matching project root for ', filePath); <ide> } <ide> <del> const extensionStart = path.lastIndexOf('.'); <del> let resource = path.substring( <add> // Replaces '\' with '/' for Windows paths. <add> if (path.sep === '\\') { <add> filePath = filePath.replace(/\\/g, '/'); <add> } <add> <add> const extensionStart = filePath.lastIndexOf('.'); <add> let resource = filePath.substring( <ide> matchingRoot.length, <ide> extensionStart !== -1 ? extensionStart : undefined, <ide> ); <ide> <del> const extension = extensionStart !== -1 <del> ? path.substring(extensionStart + 1) <del> : null; <del> <ide> return ( <ide> prefix + resource + <ide> '.' + extensionOverride + '?' +
2
Python
Python
allow trailing explanations in autosummary items
940a7d3b4e6398a742873347a2f3c605ceffe481
<ide><path>doc/sphinxext/autosummary_generate.py <ide> def get_documented_in_lines(lines, module=None, filename=None): <ide> autodoc_re = re.compile(".. auto(function|method|attribute|class|exception|module)::\s*([A-Za-z0-9_.]+)\s*$") <ide> autosummary_re = re.compile(r'^\.\.\s+autosummary::\s*') <ide> module_re = re.compile(r'^\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$') <del> autosummary_item_re = re.compile(r'^\s+([_a-zA-Z][a-zA-Z0-9_.]*)\s*') <add> autosummary_item_re = re.compile(r'^\s+([_a-zA-Z][a-zA-Z0-9_.]*)\s*.*?') <ide> toctree_arg_re = re.compile(r'^\s+:toctree:\s*(.*?)\s*$') <ide> <ide> documented = {}
1
Javascript
Javascript
fix browser error logging in `test/test.js`
5309133a9d9942234fbb4c4df5b7dc710666ff89
<ide><path>test/test.js <ide> function startBrowsers(initSessionCallback, makeStartUrl = null) { <ide> } <ide> }) <ide> .catch(function (ex) { <del> console.log(`Error while starting ${browserName}: ${ex}`); <add> console.log(`Error while starting ${browserName}: ${ex.message}`); <ide> closeSession(browserName); <ide> }); <ide> }
1
Java
Java
consider bridge methods in spel properties
fce7adc400d4b519da40d361a1b1f62fc58e185a
<ide><path>spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java <ide> import java.lang.reflect.Member; <ide> import java.lang.reflect.Method; <ide> import java.lang.reflect.Modifier; <add>import java.util.Arrays; <add>import java.util.Comparator; <ide> import java.util.Map; <ide> import java.util.concurrent.ConcurrentHashMap; <ide> <ide> private Field findField(String name, Class<?> clazz, Object target) { <ide> * Find a getter method for the specified property. <ide> */ <ide> protected Method findGetterForProperty(String propertyName, Class<?> clazz, boolean mustBeStatic) { <del> Method[] ms = clazz.getMethods(); <add> Method[] ms = getSortedClassMethods(clazz); <ide> String propertyMethodSuffix = getPropertyMethodSuffix(propertyName); <ide> <ide> // Try "get*" method... <ide> String getterName = "get" + propertyMethodSuffix; <ide> for (Method method : ms) { <del> if (!method.isBridge() && method.getName().equals(getterName) && method.getParameterTypes().length == 0 && <add> if (method.getName().equals(getterName) && method.getParameterTypes().length == 0 && <ide> (!mustBeStatic || Modifier.isStatic(method.getModifiers()))) { <ide> return method; <ide> } <ide> } <ide> // Try "is*" method... <ide> getterName = "is" + propertyMethodSuffix; <ide> for (Method method : ms) { <del> if (!method.isBridge() && method.getName().equals(getterName) && method.getParameterTypes().length == 0 && <add> if (method.getName().equals(getterName) && method.getParameterTypes().length == 0 && <ide> (boolean.class.equals(method.getReturnType()) || Boolean.class.equals(method.getReturnType())) && <ide> (!mustBeStatic || Modifier.isStatic(method.getModifiers()))) { <ide> return method; <ide> protected Method findGetterForProperty(String propertyName, Class<?> clazz, bool <ide> * Find a setter method for the specified property. <ide> */ <ide> protected Method findSetterForProperty(String propertyName, Class<?> clazz, boolean mustBeStatic) { <del> Method[] methods = clazz.getMethods(); <add> Method[] methods = getSortedClassMethods(clazz); <ide> String setterName = "set" + getPropertyMethodSuffix(propertyName); <ide> for (Method method : methods) { <del> if (!method.isBridge() && method.getName().equals(setterName) && method.getParameterTypes().length == 1 && <add> if (method.getName().equals(setterName) && method.getParameterTypes().length == 1 && <ide> (!mustBeStatic || Modifier.isStatic(method.getModifiers()))) { <ide> return method; <ide> } <ide> } <ide> return null; <ide> } <ide> <add> /** <add> * Returns class methods ordered with non bridge methods appearing higher. <add> */ <add> private Method[] getSortedClassMethods(Class<?> clazz) { <add> Method[] methods = clazz.getMethods(); <add> Arrays.sort(methods, new Comparator<Method>() { <add> @Override <add> public int compare(Method o1, Method o2) { <add> return (o1.isBridge() == o2.isBridge()) ? 0 : (o1.isBridge() ? 1 : -1); <add> } <add> }); <add> return methods; <add> } <add> <ide> protected String getPropertyMethodSuffix(String propertyName) { <ide> if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) { <ide> return propertyName; <ide><path>spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2013 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Andy Clement <ide> * @author Juergen Hoeller <ide> * @author Clark Duplichien <add> * @author Phillip Webb <ide> */ <ide> public class SpelReproTests extends ExpressionTestCase { <ide> <ide> public void SPR_9994_bridgeMethodsTest() throws Exception { <ide> assertEquals(Integer.class, value.getTypeDescriptor().getType()); <ide> } <ide> <add> @Test <add> public void SPR_10162_onlyBridgeMethodTest() throws Exception { <add> ReflectivePropertyAccessor accessor = new ReflectivePropertyAccessor(); <add> StandardEvaluationContext context = new StandardEvaluationContext(); <add> Object target = new OnlyBridgeMethod(); <add> TypedValue value = accessor.read(context, target , "property"); <add> assertEquals(Integer.class, value.getTypeDescriptor().getType()); <add> } <add> <ide> @Test <ide> public void SPR_10091_simpleTestValueType() { <ide> ExpressionParser parser = new SpelExpressionParser(); <ide> public Integer getProperty() { <ide> } <ide> } <ide> <add> static class PackagePrivateClassWithGetter { <add> <add> public Integer getProperty() { <add> return null; <add> } <add> } <add> <add> public static class OnlyBridgeMethod extends PackagePrivateClassWithGetter { <add> <add> } <add> <ide> }
2
Java
Java
initialize jndi to fix failing environment test
2667956a30960e6683e794d8bcf9860319af3ad8
<ide><path>spring-web/src/test/java/org/springframework/web/context/support/StandardServletEnvironmentTests.java <ide> <ide> package org.springframework.web.context.support; <ide> <del>import static org.hamcrest.CoreMatchers.equalTo; <del>import static org.hamcrest.CoreMatchers.is; <del>import static org.junit.Assert.assertThat; <add>import javax.naming.NamingException; <ide> <ide> import org.junit.Test; <ide> import org.springframework.core.env.ConfigurableEnvironment; <del>import org.springframework.core.env.StandardEnvironment; <ide> import org.springframework.core.env.MutablePropertySources; <ide> import org.springframework.core.env.PropertySource; <add>import org.springframework.core.env.StandardEnvironment; <add>import org.springframework.tests.mock.jndi.SimpleNamingContextBuilder; <add> <add>import static org.hamcrest.CoreMatchers.*; <add>import static org.junit.Assert.*; <ide> <ide> /** <ide> * Unit tests for {@link StandardServletEnvironment}. <ide> public class StandardServletEnvironmentTests { <ide> <ide> @Test <del> public void propertySourceOrder() { <add> public void propertySourceOrder() throws Exception { <add> SimpleNamingContextBuilder.emptyActivatedContextBuilder(); <add> <ide> ConfigurableEnvironment env = new StandardServletEnvironment(); <ide> MutablePropertySources sources = env.getPropertySources(); <ide>
1
Python
Python
unify processname logging in python 2 and 3
200c1ddb1e911d7b33c3dbeb4922e3581524c7a5
<ide><path>celery/app/log.py <ide> ) <ide> from celery.utils.term import colored <ide> <del>PY3 = sys.version_info[0] == 3 <del> <ide> MP_LOG = os.environ.get('MP_LOG', False) <ide> <ide> <ide> def setup_logging_subsystem(self, loglevel=None, logfile=None, <ide> format = format or self.format <ide> colorize = self.supports_color(colorize, logfile) <ide> reset_multiprocessing_logger() <del> if not PY3: <del> ensure_process_aware_logger() <add> ensure_process_aware_logger() <ide> receivers = signals.setup_logging.send( <ide> sender=None, loglevel=loglevel, logfile=logfile, <ide> format=format, colorize=colorize, <ide><path>celery/utils/log.py <ide> def format(self, record): <ide> type(msg), exc) <ide> record.exc_info = True <ide> <del> if not PY3 and 'processName' not in record.__dict__: <del> # Very ugly, but have to make sure processName is supported <del> # by foreign logger instances. <del> # (processName is always supported by Python 2.7) <del> process_name = current_process and current_process()._name or '' <del> record.__dict__['processName'] = process_name <ide> return safe_str(logging.Formatter.format(self, record)) <ide> <ide>
2
Mixed
Ruby
add has_one through disable_joins
f7d7a22d018c26181c9eb4254f50a77a7ece17e6
<ide><path>activerecord/CHANGELOG.md <add>* Add option to disable joins for `has_one` associations. <add> <add> In a multiple database application, associations can't join across <add> databases. When set, this option instructs Rails to generate 2 or <add> more queries rather than generating joins for `has_one` associations. <add> <add> Set the option on a has one through association: <add> <add> ```ruby <add> class Person <add> belongs_to :dog <add> has_one :veterinarian, through: :dog, disable_joins: true <add> end <add> ``` <add> <add> Then instead of generating join SQL, two queries are used for `@person.veterinarian`: <add> <add> ``` <add> SELECT "dogs"."id" FROM "dogs" WHERE "dogs"."person_id" = ? [["person_id", 1]] <add> SELECT "veterinarians".* FROM "veterinarians" WHERE "veterinarians"."dog_id" = ? [["dog_id", 1]] <add> ``` <add> <add> *Sarah Vessels*, *Eileen M. Uchitelle* <add> <ide> * `Arel::Visitors::Dot` now renders a complete set of properties when visiting <ide> `Arel::Nodes::SelectCore`, `SelectStatement`, `InsertStatement`, `UpdateStatement`, and <ide> `DeleteStatement`, which fixes #42026. Previously, some properties were omitted. <ide><path>activerecord/lib/active_record/associations.rb <ide> def has_many(name, scope = nil, **options, &extension) <ide> # <ide> # If you are going to modify the association (rather than just read from it), then it is <ide> # a good idea to set the <tt>:inverse_of</tt> option. <add> # [:disable_joins] <add> # Specifies whether joins should be skipped for an association. If set to true, two or more queries <add> # will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory <add> # due to database limitations. This option is only applicable on `has_one :through` associations as <add> # `has_one` alone does not perform a join. <add> # <add> # If the association on the join model is a #belongs_to, the collection can be modified <add> # and the records on the <tt>:through</tt> model will be automatically created and removed <add> # as appropriate. Otherwise, the collection is read-only, so you should manipulate the <add> # <tt>:through</tt> association directly. <add> # <add> # If you are going to modify the association (rather than just read from it), then it is <add> # a good idea to set the <tt>:inverse_of</tt> option on the source association on the <add> # join model. This allows associated records to be built which will automatically create <add> # the appropriate join model records when they are saved. (See the 'Association Join Models' <add> # section above.) <ide> # [:source] <ide> # Specifies the source association name used by #has_one <tt>:through</tt> queries. <ide> # Only use it if the name cannot be inferred from the association. <ide> def has_many(name, scope = nil, **options, &extension) <ide> # has_one :attachment, as: :attachable <ide> # has_one :boss, -> { readonly } <ide> # has_one :club, through: :membership <add> # has_one :club, through: :membership, disable_joins: true <ide> # has_one :primary_address, -> { where(primary: true) }, through: :addressables, source: :addressable <ide> # has_one :credit_card, required: true <ide> # has_one :credit_card, strict_loading: true <ide><path>activerecord/lib/active_record/associations/builder/has_one.rb <ide> def self.valid_options(options) <ide> valid += [:as, :foreign_type] if options[:as] <ide> valid += [:ensuring_owner_was] if options[:dependent] == :destroy_async <ide> valid += [:through, :source, :source_type] if options[:through] <add> valid += [:disable_joins] if options[:disable_joins] && options[:through] <ide> valid <ide> end <ide> <ide><path>activerecord/lib/active_record/associations/has_one_through_association.rb <ide> module Associations <ide> class HasOneThroughAssociation < HasOneAssociation #:nodoc: <ide> include ThroughAssociation <ide> <add> def find_target <add> return scope.first if disable_joins <add> <add> super <add> end <add> <ide> private <ide> def replace(record, save = true) <ide> create_through_record(record, save) <ide><path>activerecord/test/cases/associations/has_one_through_disable_joins_associations_test.rb <add># frozen_string_literal: true <add> <add>require "cases/helper" <add>require "models/member" <add>require "models/organization" <add> <add>class HasOneThroughDisableJoinsAssociationsTest < ActiveRecord::TestCase <add> fixtures :members, :organizations <add> <add> def setup <add> @member = members(:groucho) <add> @organization = organizations(:discordians) <add> @member.organization = @organization <add> @member.save! <add> @member.reload <add> end <add> <add> def test_counting_on_disable_joins_through <add> no_joins = capture_sql { @member.organization_without_joins } <add> joins = capture_sql { @member.organization } <add> <add> assert_equal @member.organization, @member.organization_without_joins <add> assert_equal 2, no_joins.count <add> assert_equal 1, joins.count <add> assert_match(/INNER JOIN/, joins.first) <add> no_joins.each do |nj| <add> assert_no_match(/INNER JOIN/, nj) <add> end <add> end <add> <add> def test_nil_on_disable_joins_through <add> member = members(:blarpy_winkup) <add> assert_nil assert_queries(1) { member.organization } <add> assert_nil assert_queries(1) { member.organization_without_joins } <add> end <add> <add> def test_preload_on_disable_joins_through <add> members = Member.preload(:organization, :organization_without_joins).to_a <add> assert_no_queries { members[0].organization } <add> assert_no_queries { members[0].organization_without_joins } <add> end <add>end <ide><path>activerecord/test/models/member.rb <ide> class Member < ActiveRecord::Base <ide> has_one :sponsor_club, through: :sponsor <ide> has_one :member_detail, inverse_of: false <ide> has_one :organization, through: :member_detail <add> has_one :organization_without_joins, through: :member_detail, disable_joins: true, source: :organization <ide> belongs_to :member_type <ide> <ide> has_many :nested_member_types, through: :member_detail, source: :member_type <ide><path>guides/source/active_record_multiple_databases.md <ide> connections globally. <ide> ### Handling associations with joins across databases <ide> <ide> As of Rails 7.0+, Active Record has an option for handling associations that would perform <del>a join across multiple databases. If you have a has many through association that you want to <del>disable joining and perform 2 or more queries, pass the `disable_joins: true` option. <add>a join across multiple databases. If you have a has many through or a has one through association <add>that you want to disable joining and perform 2 or more queries, pass the `disable_joins: true` option. <ide> <ide> For example: <ide> <ide> ```ruby <ide> class Dog < AnimalsRecord <ide> has_many :treats, through: :humans, disable_joins: true <ide> has_many :humans <add> <add> belongs_to :home <add> has_one :yard, through: :home, disable_joins: true <ide> end <ide> ``` <ide> <del>Previously calling `@dog.treats` without `disable_joins` would raise an error because databases are unable <del>to handle joins across clusters. With the `disable_joins` option, Rails will generate multiple select queries <del>to avoid attempting joining across clusters. For the above association `@dog.treats` would generate the <add>Previously calling `@dog.treats` without `disable_joins` or `@dog.yard` without `disable_joins` <add>would raise an error because databases are unable to handle joins across clusters. With the <add>`disable_joins` option, Rails will generate multiple select queries <add>to avoid attempting joining across clusters. For the above association, `@dog.treats` would generate the <ide> following SQL: <ide> <ide> ```sql <ide> SELECT "humans"."id" FROM "humans" WHERE "humans"."dog_id" = ? [["dog_id", 1]] <ide> SELECT "treats".* FROM "treats" WHERE "treats"."human_id" IN (?, ?, ?) [["human_id", 1], ["human_id", 2], ["human_id", 3]] <ide> ``` <ide> <add>While `@dog.yard` would generate the following SQL: <add> <add>```sql <add>SELECT "home"."id" FROM "homes" WHERE "homes"."dog_id" = ? [["dog_id", 1]] <add>SELECT "yards".* FROM "yards" WHERE "yards"."home_id" = ? [["home_id", 1]] <add>``` <add> <ide> There are some important things to be aware of with this option: <ide> <ide> 1) There may be performance implications since now two or more queries will be performed (depending <ide> on the association) rather than a join. If the select for `humans` returned a high number of IDs <ide> the select for `treats` may send too many IDs. <del>2) Since we are no longer performing joins a query with an order or limit is now sorted in-memory since <add>2) Since we are no longer performing joins, a query with an order or limit is now sorted in-memory since <ide> order from one table cannot be applied to another table. <del>3) This setting must be added to all associations that you want joining to be disabled. <add>3) This setting must be added to all associations where you want joining to be disabled. <ide> Rails can't guess this for you because association loading is lazy, to load `treats` in `@dog.treats` <ide> Rails already needs to know what SQL should be generated. <ide>
7
Python
Python
remove dead code
c2bb0f9a1d5e3d58b7bc35142167a0d76e0e590b
<ide><path>numpy/lib/tests/test_io.py <ide> def test_named_arrays(self): <ide> <ide> <ide> class TestSaveTxt(TestCase): <del> #@np.testing.dec.knownfailureif(sys.platform=='win32', "Fail on Win32") <ide> def test_array(self): <ide> a =np.array([[1, 2], [3, 4]], float) <ide> fmt = "%.18e"
1
Python
Python
ignore f401 flake8 warning (x326 / 594)
654e051e2a602b822e6804a6199bb7d0e841dfdc
<ide><path>transformers/__init__.py <add># flake8: noqa <add># There's no way to ignore "F401 '...' imported but unused" warnings in this <add># module, but to preserve other warnings. So, don't check this module at all. <add> <ide> __version__ = "2.3.0" <ide> <ide> # Work around to update TensorFlow's absl.logging threshold which alters the <ide><path>transformers/data/__init__.py <add># flake8: noqa <add># There's no way to ignore "F401 '...' imported but unused" warnings in this <add># module, but to preserve other warnings. So, don't check this module at all. <add> <ide> from .metrics import is_sklearn_available <ide> from .processors import ( <ide> DataProcessor, <ide><path>transformers/data/processors/__init__.py <add># flake8: noqa <add># There's no way to ignore "F401 '...' imported but unused" warnings in this <add># module, but to preserve other warnings. So, don't check this module at all. <add> <ide> from .glue import glue_convert_examples_to_features, glue_output_modes, glue_processors, glue_tasks_num_labels <ide> from .squad import SquadExample, SquadFeatures, SquadV1Processor, SquadV2Processor, squad_convert_examples_to_features <ide> from .utils import DataProcessor, InputExample, InputFeatures, SingleSentenceClassificationProcessor
3
Ruby
Ruby
remove non-existent download strategies
29182ad0682430f34f65947a38da58dd712efd46
<ide><path>Library/Homebrew/dev-cmd/audit.rb <ide> def audit_download_strategy <ide> <ide> return unless using <ide> <del> if using == :ssl3 || \ <del> (Object.const_defined?("CurlSSL3DownloadStrategy") && using == CurlSSL3DownloadStrategy) <del> problem "The SSL3 download strategy is deprecated, please choose a different URL" <del> elsif (Object.const_defined?("CurlUnsafeDownloadStrategy") && using == CurlUnsafeDownloadStrategy) || \ <del> (Object.const_defined?("UnsafeSubversionDownloadStrategy") && using == UnsafeSubversionDownloadStrategy) <del> problem "#{using.name} is deprecated, please choose a different URL" <del> end <del> <ide> if using == :cvs <ide> mod = specs[:module] <ide> <ide><path>Library/Homebrew/download_strategy.rb <ide> def self.detect_from_symbol(symbol) <ide> when :bzr then BazaarDownloadStrategy <ide> when :svn then SubversionDownloadStrategy <ide> when :curl then CurlDownloadStrategy <del> when :ssl3 then CurlSSL3DownloadStrategy <ide> when :cvs then CVSDownloadStrategy <ide> when :post then CurlPostDownloadStrategy <ide> when :fossil then FossilDownloadStrategy
2
PHP
PHP
add tests for `ids` option in marshaller
10e81465d3aae06d1c39ac2ce22e3b33f02b8251
<ide><path>tests/TestCase/ORM/MarshallerTest.php <ide> public function testOneBelongsToManyJoinData() <ide> ); <ide> } <ide> <add> /** <add> * Test that the ids option restricts to only accepting ids for belongs to many associations. <add> * <add> * @return void <add> */ <add> public function testOneBelongsToManyOnlyIdsRejectArray() <add> { <add> $data = [ <add> 'title' => 'My title', <add> 'body' => 'My content', <add> 'author_id' => 1, <add> 'tags' => [ <add> ['tag' => 'news'], <add> ['tag' => 'cakephp'], <add> ], <add> ]; <add> $marshall = new Marshaller($this->articles); <add> $result = $marshall->one($data, [ <add> 'associated' => ['Tags' => ['ids' => true]] <add> ]); <add> $this->assertEmpty($result->tags, 'Only ids should be marshalled.'); <add> } <add> <add> /** <add> * Test that the ids option restricts to only accepting ids for belongs to many associations. <add> * <add> * @return void <add> */ <add> public function testOneBelongsToManyOnlyIdsWithIds() <add> { <add> $data = [ <add> 'title' => 'My title', <add> 'body' => 'My content', <add> 'author_id' => 1, <add> 'tags' => [ <add> '_ids' => [1, 2], <add> ['tag' => 'news'], <add> ], <add> ]; <add> $marshall = new Marshaller($this->articles); <add> $result = $marshall->one($data, [ <add> 'associated' => ['Tags' => ['ids' => true]] <add> ]); <add> $this->assertCount(2, $result->tags, 'Ids should be marshalled.'); <add> } <add> <ide> /** <ide> * Test marshalling nested associations on the _joinData structure. <ide> * <ide> public function testBelongsToManyWithMixedData() <ide> * <ide> * @return void <ide> */ <del> public function testHasManyWithIds() <add> public function testOneHasManyWithIds() <ide> { <ide> $data = [ <ide> 'title' => 'article', <ide> public function testHasManyWithIds() <ide> $this->assertEquals($article->comments[1], $this->comments->get(2)); <ide> } <ide> <add> /** <add> * Test that the ids option restricts to only accepting ids for hasmany associations. <add> * <add> * @return void <add> */ <add> public function testOneHasManyOnlyIdsRejectArray() <add> { <add> $data = [ <add> 'title' => 'article', <add> 'body' => 'some content', <add> 'comments' => [ <add> ['comment' => 'first comment'], <add> ['comment' => 'second comment'], <add> ] <add> ]; <add> <add> $marshaller = new Marshaller($this->articles); <add> $article = $marshaller->one($data, [ <add> 'associated' => ['Comments' => ['ids' => true]] <add> ]); <add> $this->assertEmpty($article->comments); <add> } <add> <add> /** <add> * Test that the ids option restricts to only accepting ids for hasmany associations. <add> * <add> * @return void <add> */ <add> public function testOneHasManyOnlyIdsWithIds() <add> { <add> $data = [ <add> 'title' => 'article', <add> 'body' => 'some content', <add> 'comments' => [ <add> '_ids' => [1, 2], <add> ['comment' => 'first comment'], <add> ] <add> ]; <add> <add> $marshaller = new Marshaller($this->articles); <add> $article = $marshaller->one($data, [ <add> 'associated' => ['Comments' => ['ids' => true]] <add> ]); <add> $this->assertCount(2, $article->comments); <add> } <add> <ide> /** <ide> * Test HasMany association with invalid data <ide> * <ide> * @return void <ide> */ <del> public function testHasManyInvalidData() <add> public function testOneHasManyInvalidData() <ide> { <ide> $data = [ <ide> 'title' => 'new title', <ide> public function testMergeBelongsToManyEntitiesFromIdsEmptyValue() <ide> $this->assertCount(0, $result->tags); <ide> } <ide> <add> /** <add> * Test that the ids option restricts to only accepting ids for belongs to many associations. <add> * <add> * @return void <add> */ <add> public function testMergeBelongsToManyOnlyIdsRejectArray() <add> { <add> $entity = new Entity([ <add> 'title' => 'Haz tags', <add> 'body' => 'Some content here', <add> 'tags' => [ <add> new Entity(['id' => 1, 'name' => 'Cake']), <add> new Entity(['id' => 2, 'name' => 'PHP']) <add> ] <add> ]); <add> <add> $data = [ <add> 'title' => 'Haz moar tags', <add> 'tags' => [ <add> ['name' => 'new'], <add> ['name' => 'awesome'] <add> ] <add> ]; <add> $entity->accessible('*', true); <add> $marshall = new Marshaller($this->articles); <add> $result = $marshall->merge($entity, $data, [ <add> 'associated' => ['Tags' => ['ids' => true]] <add> ]); <add> $this->assertCount(0, $result->tags); <add> } <add> <add> /** <add> * Test that the ids option restricts to only accepting ids for belongs to many associations. <add> * <add> * @return void <add> */ <add> public function testMergeBelongsToManyOnlyIdsWithIds() <add> { <add> $entity = new Entity([ <add> 'title' => 'Haz tags', <add> 'body' => 'Some content here', <add> 'tags' => [ <add> new Entity(['id' => 1, 'name' => 'Cake']), <add> new Entity(['id' => 2, 'name' => 'PHP']) <add> ] <add> ]); <add> <add> $data = [ <add> 'title' => 'Haz moar tags', <add> 'tags' => [ <add> '_ids' => [3] <add> ] <add> ]; <add> $entity->accessible('*', true); <add> $marshall = new Marshaller($this->articles); <add> $result = $marshall->merge($entity, $data, [ <add> 'associated' => ['Tags' => ['ids' => true]] <add> ]); <add> $this->assertCount(1, $result->tags); <add> $this->assertEquals('tag3', $result->tags[0]->name); <add> } <add> <ide> /** <ide> * Test that invalid _joinData (scalar data) is not marshalled. <ide> *
1
Text
Text
use parenthesis instead of em dash
29bb2bb57d2a993e4e79172fe6b954f8047eee81
<ide><path>doc/api/crypto.md <ide> try { <ide> <ide> When using the lexical ESM `import` keyword, the error can only be <ide> caught if a handler for `process.on('uncaughtException')` is registered <del>_before_ any attempt to load the module is made -- using, for instance, <del>a preload module. <add>_before_ any attempt to load the module is made (using, for instance, <add>a preload module). <ide> <ide> When using ESM, if there is a chance that the code may be run on a build <ide> of Node.js where crypto support is not enabled, consider using the
1
Ruby
Ruby
pass repository path into the updater
8d12684efe43e20b62d4f20836c673051107246e
<ide><path>Library/Homebrew/cmd/update.rb <ide> def update <ide> unlink_tap_formula(tapped_formulae) <ide> <ide> report = Report.new <del> master_updater = Updater.new <add> master_updater = Updater.new(HOMEBREW_REPOSITORY) <ide> begin <ide> master_updater.pull! <ide> ensure <ide> def update <ide> <ide> each_tap do |user, repo| <ide> repo.cd do <del> updater = Updater.new <add> updater = Updater.new(repo) <ide> <ide> begin <ide> updater.pull! <ide> def load_tap_migrations <ide> end <ide> <ide> class Updater <del> attr_reader :initial_revision, :current_revision <add> attr_reader :initial_revision, :current_revision, :repository <add> <add> def initialize(repository) <add> @repository = repository <add> end <ide> <ide> def pull! <ide> safe_system "git", "checkout", "-q", "master" <ide> def report <ide> when :R then $3 <ide> else $2 <ide> end <del> map[status] << Pathname.pwd.join(path) <add> map[status] << repository.join(path) <ide> end <ide> end <ide> <ide><path>Library/Homebrew/test/test_updater.rb <ide> <ide> class UpdaterTests < Homebrew::TestCase <ide> class UpdaterMock < ::Updater <del> def initialize(*args) <add> def initialize(*) <ide> super <ide> @outputs = Hash.new { |h, k| h[k] = [] } <ide> @expected = [] <ide> def self.fixture_data <ide> end <ide> <ide> def setup <del> @updater = UpdaterMock.new <add> @updater = UpdaterMock.new(HOMEBREW_REPOSITORY) <ide> @report = Report.new <ide> end <ide>
2
PHP
PHP
apply fixes from styleci
6149c624aefceef18829dec971249b6948891a64
<ide><path>src/Illuminate/Support/Testing/Fakes/MailFake.php <ide> public function send($view, array $data = [], $callback = null) <ide> <ide> $view->mailer($this->currentMailer); <ide> <del> <ide> if ($view instanceof ShouldQueue) { <ide> return $this->queue($view, $data); <ide> }
1
Python
Python
remove features class
8e0f0b48cfb677f6df6bb827452080b39015248e
<ide><path>libcloud/base.py <ide> import hashlib <ide> from pipes import quote as pquote <ide> <del>class Features(object): <del> AUTH_SSH_KEY = 1 <del> AUTH_PASSWORD = 2 <del> <ide> class Node(object): <ide> """ <ide> A Base Node class to derive from.
1
Python
Python
fix test_connection implementation
2f70daf5ac36100ff0bbd4ac66ce921a2bc6dea0
<ide><path>airflow/providers/databricks/hooks/databricks.py <ide> <ide> RUN_LIFE_CYCLE_STATES = ['PENDING', 'RUNNING', 'TERMINATING', 'TERMINATED', 'SKIPPED', 'INTERNAL_ERROR'] <ide> <del>LIST_ZONES_ENDPOINT = ('GET', 'api/2.0/clusters/list-zones') <add>SPARK_VERSIONS_ENDPOINT = ('GET', 'api/2.0/clusters/spark-versions') <ide> <ide> <ide> class RunState: <ide> def test_connection(self): <ide> """Test the Databricks connectivity from UI""" <ide> hook = DatabricksHook(databricks_conn_id=self.databricks_conn_id) <ide> try: <del> hook._do_api_call(endpoint_info=LIST_ZONES_ENDPOINT).get('zones') <add> hook._do_api_call(endpoint_info=SPARK_VERSIONS_ENDPOINT).get('versions') <ide> status = True <ide> message = 'Connection successfully tested' <ide> except Exception as e: <ide><path>tests/providers/databricks/hooks/test_databricks.py <ide> ], <ide> 'has_more': False, <ide> } <del>LIST_ZONES_RESPONSE = {'zones': ['us-east-2b', 'us-east-2c', 'us-east-2a'], 'default_zone': 'us-east-2b'} <add>LIST_SPARK_VERSIONS_RESPONSE = { <add> "versions": [ <add> {"key": "8.2.x-scala2.12", "name": "8.2 (includes Apache Spark 3.1.1, Scala 2.12)"}, <add> ] <add>} <ide> <ide> <ide> def run_now_endpoint(host): <ide> def list_jobs_endpoint(host): <ide> return f'https://{host}/api/2.1/jobs/list' <ide> <ide> <del>def list_zones_endpoint(host): <del> """Utility function to generate the list zones endpoint given the host""" <del> return f'https://{host}/api/2.0/clusters/list-zones' <add>def list_spark_versions_endpoint(host): <add> """Utility function to generate the list spark versions endpoint given the host""" <add> return f'https://{host}/api/2.0/clusters/spark-versions' <ide> <ide> <ide> def create_valid_response_mock(content): <ide> def test_get_job_id_by_name_raise_exception_with_duplicates(self, mock_requests) <ide> @mock.patch('airflow.providers.databricks.hooks.databricks_base.requests') <ide> def test_connection_success(self, mock_requests): <ide> mock_requests.codes.ok = 200 <del> mock_requests.get.return_value.json.return_value = LIST_ZONES_RESPONSE <add> mock_requests.get.return_value.json.return_value = LIST_SPARK_VERSIONS_RESPONSE <ide> status_code_mock = mock.PropertyMock(return_value=200) <ide> type(mock_requests.get.return_value).status_code = status_code_mock <ide> response = self.hook.test_connection() <ide> assert response == (True, 'Connection successfully tested') <ide> mock_requests.get.assert_called_once_with( <del> list_zones_endpoint(HOST), <add> list_spark_versions_endpoint(HOST), <ide> json=None, <ide> params=None, <ide> auth=HTTPBasicAuth(LOGIN, PASSWORD), <ide> def test_connection_failure(self, mock_requests): <ide> response = self.hook.test_connection() <ide> assert response == (False, 'Connection Failure') <ide> mock_requests.get.assert_called_once_with( <del> list_zones_endpoint(HOST), <add> list_spark_versions_endpoint(HOST), <ide> json=None, <ide> params=None, <ide> auth=HTTPBasicAuth(LOGIN, PASSWORD),
2
Ruby
Ruby
improve consistency of *_version methods
fb653c00d8152da765b56c0bb1ae7bba5bf7002d
<ide><path>Library/Homebrew/livecheck/livecheck.rb <ide> def latest_version( <ide> version.to_s.include?(rejection) <ide> end <ide> end <del> <ide> next if match_version_map.blank? <ide> <ide> if debug <ide> def resource_version( <ide> urls ||= checkable_urls(resource) <ide> <ide> checked_urls = [] <del> <ide> # rubocop:disable Metrics/BlockLength <ide> urls.each_with_index do |original_url, i| <ide> # Only preprocess the URL when it's appropriate <ide> def resource_version( <ide> regex_provided: livecheck_regex.present?, <ide> block_provided: livecheck_strategy_block.present?, <ide> ) <del> <ide> strategy = Strategy.from_symbol(livecheck_strategy) || strategies.first <ide> strategy_name = livecheck_strategy_names[strategy] <ide> <ide> def resource_version( <ide> next if strategy.blank? <ide> <ide> strategy_data = strategy.find_versions( <del> url: url, regex: livecheck_regex, <del> homebrew_curl: false, &livecheck_strategy_block <add> url: url, <add> regex: livecheck_regex, <add> homebrew_curl: false, <add> &livecheck_strategy_block <ide> ) <ide> match_version_map = strategy_data[:matches] <ide> regex = strategy_data[:regex] <ide> def resource_version( <ide> resource_version_info[:meta][:url][:final] = strategy_data[:final_url] if strategy_data[:final_url] <ide> resource_version_info[:meta][:strategy] = strategy.present? ? strategy_name : nil <ide> if strategies.present? <del> resource_version_info[:meta][:strategies] = strategies.map do |s| <del> livecheck_strategy_names[s] <del> end <add> resource_version_info[:meta][:strategies] = strategies.map { |s| livecheck_strategy_names[s] } <ide> end <ide> resource_version_info[:meta][:regex] = regex.inspect if regex.present? <ide> resource_version_info[:meta][:cached] = true if strategy_data[:cached] == true
1
Text
Text
fix incorrect package name on oracle linux
d9f4e5c13ccb5c76547937399078784e4e7ed023
<ide><path>docs/installation/oracle.md <ide> btrfs storage engine on both Oracle Linux 6 and 7. <ide> <ide> 4. Install the Docker package. <ide> <del> $ sudo yum install docker <add> $ sudo yum install docker-engine <ide> <ide> 5. Start the Docker daemon. <ide> <ide> To enable btrfs support on Oracle Linux: <ide> <ide> To uninstall the Docker package: <ide> <del> $ sudo yum -y remove docker <add> $ sudo yum -y remove docker-engine <ide> <ide> The above command will not remove images, containers, volumes, or user created <ide> configuration files on your host. If you wish to delete all images, containers,
1
PHP
PHP
use templatepath() instead of viewpath()
efa41b11ff319a72747a01ae746b3fe9998c9d92
<ide><path>src/Controller/Component/AuthComponent.php <ide> protected function _unauthenticated(Controller $controller) <ide> } <ide> <ide> if (!empty($this->_config['ajaxLogin'])) { <del> $controller->viewBuilder()->viewPath('Element'); <add> $controller->viewBuilder()->templatePath('Element'); <ide> $response = $controller->render( <ide> $this->_config['ajaxLogin'], <ide> $this->RequestHandler->ajaxLayout <ide><path>src/Controller/Component/RequestHandlerComponent.php <ide> public function renderAs(Controller $controller, $type, array $options = []) <ide> $builder->className($viewClass); <ide> } else { <ide> if (empty($this->_renderType)) { <del> $builder->viewPath($builder->viewPath() . DS . $type); <add> $builder->templatePath($builder->templatePath() . DS . $type); <ide> } else { <del> $builder->viewPath(preg_replace( <add> $builder->templatePath(preg_replace( <ide> "/([\/\\\\]{$this->_renderType})$/", <ide> DS . $type, <del> $builder->viewPath() <add> $builder->templatePath() <ide> )); <ide> } <ide> <ide><path>src/Controller/Controller.php <ide> public function loadComponent($name, array $config = []) <ide> public function __get($name) <ide> { <ide> if (in_array($name, ['layout', 'view', 'theme', 'autoLayout', 'viewPath', 'layoutPath'], true)) { <add> $method = $name == 'viewPath' ? 'templatePath' : $name; <ide> trigger_error( <del> sprintf('Controller::$%s is deprecated. Use $this->viewBuilder()->%s() instead.', $name, $name), <add> sprintf('Controller::$%s is deprecated. Use $this->viewBuilder()->%s() instead.', $name, $method), <ide> E_USER_DEPRECATED <ide> ); <ide> return $this->viewBuilder()->{$name}(); <ide> public function setAction($action) <ide> public function render($view = null, $layout = null) <ide> { <ide> $builder = $this->viewBuilder(); <del> if (!$builder->viewPath()) { <del> $builder->viewPath($this->_viewPath()); <add> if (!$builder->templatePath()) { <add> $builder->templatePath($this->_viewPath()); <ide> } <ide> <ide> if (!empty($this->request->params['bare'])) { <ide><path>src/Controller/ErrorController.php <ide> public function __construct($request = null, $response = null) <ide> */ <ide> public function beforeRender(Event $event) <ide> { <del> $this->viewBuilder()->viewPath('Error'); <add> $this->viewBuilder()->templatePath('Error'); <ide> } <ide> } <ide><path>src/Error/ExceptionRenderer.php <ide> protected function _outputMessageSafe($template) <ide> $builder = $this->controller->viewBuilder(); <ide> $builder->helpers($helpers, false) <ide> ->layoutPath('') <del> ->viewPath('Error'); <add> ->templatePath('Error'); <ide> $view = $this->controller->createView(); <ide> <ide> $this->controller->response->body($view->render($template, 'error')); <ide><path>src/View/ViewBuilder.php <ide> class ViewBuilder <ide> { <ide> /** <del> * The subdirectory to the view. <add> * The subdirectory to the template. <ide> * <ide> * @var string <ide> */ <del> protected $_viewPath; <add> protected $_templatePath; <ide> <ide> /** <ide> * The template file to render. <ide> class ViewBuilder <ide> protected $_helpers = []; <ide> <ide> /** <del> * Get/set path for view files. <add> * Get/set path for template files. <ide> * <ide> * @param string|null $path Path for view files. If null returns current path. <ide> * @return string|$this <ide> */ <del> public function viewPath($path = null) <add> public function templatePath($path = null) <ide> { <ide> if ($path === null) { <del> return $this->_viewPath; <add> return $this->_templatePath; <ide> } <ide> <del> $this->_viewPath = $path; <add> $this->_templatePath = $path; <ide> return $this; <ide> } <ide> <ide> public function build($vars = [], Request $request = null, Response $response = <ide> } <ide> $data = [ <ide> 'name' => $this->_name, <del> 'viewPath' => $this->_viewPath, <add> 'viewPath' => $this->_templatePath, <ide> 'view' => $this->_template, <ide> 'plugin' => $this->_plugin, <ide> 'theme' => $this->_theme, <ide><path>tests/TestCase/Controller/Component/RequestHandlerComponentTest.php <ide> public function testNoViewClassExtension() <ide> return $this->Controller->response; <ide> }); <ide> $this->Controller->render(); <del> $this->assertEquals('RequestHandlerTest' . DS . 'csv', $this->Controller->viewBuilder()->viewPath()); <add> $this->assertEquals('RequestHandlerTest' . DS . 'csv', $this->Controller->viewBuilder()->templatePath()); <ide> $this->assertEquals('csv', $this->Controller->viewBuilder()->layoutPath()); <ide> } <ide> <ide> public function testRenderAs() <ide> $this->RequestHandler->renderAs($this->Controller, 'rss'); <ide> $this->assertTrue(in_array('Rss', $this->Controller->helpers)); <ide> <del> $this->Controller->viewBuilder()->viewPath('request_handler_test\\rss'); <add> $this->Controller->viewBuilder()->templatePath('request_handler_test\\rss'); <ide> $this->RequestHandler->renderAs($this->Controller, 'js'); <del> $this->assertEquals('request_handler_test' . DS . 'js', $this->Controller->viewBuilder()->viewPath()); <add> $this->assertEquals('request_handler_test' . DS . 'js', $this->Controller->viewBuilder()->templatePath()); <ide> } <ide> <ide> /** <ide> public function testRenderAsCalledTwice() <ide> $this->Controller->render(); <ide> <ide> $this->RequestHandler->renderAs($this->Controller, 'print'); <del> $this->assertEquals('RequestHandlerTest' . DS . 'print', $this->Controller->viewBuilder()->viewPath()); <add> $this->assertEquals('RequestHandlerTest' . DS . 'print', $this->Controller->viewBuilder()->templatePath()); <ide> $this->assertEquals('print', $this->Controller->viewBuilder()->layoutPath()); <ide> <ide> $this->RequestHandler->renderAs($this->Controller, 'js'); <del> $this->assertEquals('RequestHandlerTest' . DS . 'js', $this->Controller->viewBuilder()->viewPath()); <add> $this->assertEquals('RequestHandlerTest' . DS . 'js', $this->Controller->viewBuilder()->templatePath()); <ide> $this->assertEquals('js', $this->Controller->viewBuilder()->layoutPath()); <ide> } <ide> <ide><path>tests/TestCase/Controller/ControllerTest.php <ide> public function testRender() <ide> $request->params['action'] = 'index'; <ide> <ide> $Controller = new Controller($request, new Response()); <del> $Controller->viewBuilder()->viewPath('Posts'); <add> $Controller->viewBuilder()->templatePath('Posts'); <ide> <ide> $result = $Controller->render('index'); <ide> $this->assertRegExp('/posts index/', (string)$result); <ide> public function testViewPathConventions() <ide> return $e->subject()->response; <ide> }); <ide> $Controller->render(); <del> $this->assertEquals('Admin' . DS . 'Posts', $Controller->viewBuilder()->viewPath()); <add> $this->assertEquals('Admin' . DS . 'Posts', $Controller->viewBuilder()->templatePath()); <ide> <ide> $request->addParams([ <ide> 'prefix' => 'admin/super' <ide> public function testViewPathConventions() <ide> return $e->subject()->response; <ide> }); <ide> $Controller->render(); <del> $this->assertEquals('Admin' . DS . 'Super' . DS . 'Posts', $Controller->viewBuilder()->viewPath()); <add> $this->assertEquals('Admin' . DS . 'Super' . DS . 'Posts', $Controller->viewBuilder()->templatePath()); <ide> <ide> $request = new Request('pages/home'); <ide> $request->addParams([ <ide> public function testViewPathConventions() <ide> return $e->subject()->response; <ide> }); <ide> $Controller->render(); <del> $this->assertEquals('Pages', $Controller->viewBuilder()->viewPath()); <add> $this->assertEquals('Pages', $Controller->viewBuilder()->templatePath()); <ide> } <ide> <ide> /** <ide><path>tests/TestCase/Controller/PagesControllerTest.php <ide> public function testDisplay() <ide> { <ide> $Pages = new PagesController(new Request(), new Response()); <ide> <del> $Pages->viewBuilder()->viewPath('Posts'); <add> $Pages->viewBuilder()->templatePath('Posts'); <ide> $Pages->display('index'); <ide> $this->assertRegExp('/posts index/', $Pages->response->body()); <ide> $this->assertEquals('index', $Pages->viewVars['page']); <ide><path>tests/TestCase/Error/ExceptionRendererTest.php <ide> public function testMissingLayoutPathRenderSafe() <ide> <ide> $ExceptionRenderer->render(); <ide> $this->assertEquals('', $ExceptionRenderer->controller->viewBuilder()->layoutPath()); <del> $this->assertEquals('Error', $ExceptionRenderer->controller->viewBuilder()->viewPath()); <add> $this->assertEquals('Error', $ExceptionRenderer->controller->viewBuilder()->templatePath()); <ide> } <ide> <ide> /** <ide><path>tests/TestCase/View/ViewBuilderTest.php <ide> public function stringPropertyProvider() <ide> { <ide> return [ <ide> ['layoutPath', 'Admin/'], <del> ['viewPath', 'Admin/'], <add> ['templatePath', 'Admin/'], <ide> ['plugin', 'TestPlugin'], <ide> ['layout', 'admin'], <ide> ['theme', 'TestPlugin'], <ide> public function testBuildComplete() <ide> ->className('Ajax') <ide> ->template('edit') <ide> ->layout('default') <del> ->viewPath('Articles/') <add> ->templatePath('Articles/') <ide> ->helpers(['Form', 'Html']) <ide> ->layoutPath('Admin/') <ide> ->theme('TestTheme') <ide><path>tests/test_app/TestApp/Controller/RequestHandlerTestController.php <ide> class RequestHandlerTestController extends Controller <ide> */ <ide> public function destination() <ide> { <del> $this->viewBuilder()->viewPath('Posts'); <add> $this->viewBuilder()->templatePath('Posts'); <ide> $this->render('index'); <ide> } <ide> <ide><path>tests/test_app/TestApp/Error/TestAppsExceptionRenderer.php <ide> protected function _getController() <ide> $controller->viewBuilder()->layout('banana'); <ide> } catch (\Exception $e) { <ide> $controller = new Controller($request, $response); <del> $controller->viewBuilder()->viewPath('Error'); <add> $controller->viewBuilder()->templatePath('Error'); <ide> } <ide> return $controller; <ide> }
13
Ruby
Ruby
use add_to_env instead of an initializer
39928c8db23ce555360f866f21ccedfc49bc95d3
<ide><path>railties/test/application/asset_debugging_test.rb <ide> class ::PostsController < ActionController::Base ; end <ide> end <ide> <ide> test "assets aren't concatened when compile is true is on and debug_assets params is true" do <del> app_file "config/initializers/compile.rb", "Rails.application.config.assets.compile = true" <add> add_to_env_config "production", "config.assets.compile = true" <ide> <ide> ENV["RAILS_ENV"] = "production" <ide> require "#{app_path}/config/environment"
1
Text
Text
improve fs api descriptions
35511c8ba11afb122c2b0ecfa7e8d7b70f295f93
<ide><path>doc/api/fs.md <ide> changes: <ide> * `callback` {Function} <ide> * `err` {Error} <ide> <del>Asynchronous chmod(2). No arguments other than a possible exception are given <del>to the completion callback. <add>Asynchronously changes the permissions of a file. No arguments other than a <add>possible exception are given to the completion callback. <add> <add>See also: chmod(2) <ide> <ide> ## fs.chmodSync(path, mode) <ide> <!-- YAML <ide> changes: <ide> * `path` {string|Buffer|URL} <ide> * `mode` {integer} <ide> <del>Synchronous chmod(2). Returns `undefined`. <add>Synchronously changes the permissions of a file. Returns `undefined`. <add>This is the synchronous version of [`fs.chmod()`][]. <add> <add>See also: chmod(2) <ide> <ide> ## fs.chown(path, uid, gid, callback) <ide> <!-- YAML <ide> changes: <ide> * `callback` {Function} <ide> * `err` {Error} <ide> <del>Asynchronous chown(2). No arguments other than a possible exception are given <del>to the completion callback. <add>Asynchronously changes owner and group of a file. No arguments other than a <add>possible exception are given to the completion callback. <add> <add>See also: chown(2) <ide> <ide> ## fs.chownSync(path, uid, gid) <ide> <!-- YAML <ide> changes: <ide> * `uid` {integer} <ide> * `gid` {integer} <ide> <del>Synchronous chown(2). Returns `undefined`. <add>Synchronously changes owner and group of a file. Returns `undefined`. <add>This is the synchronous version of [`fs.chown()`][]. <add> <add>See also: chown(2) <ide> <ide> ## fs.close(fd, callback) <ide> <!-- YAML <ide> changes: <ide> * `callback` {Function} <ide> * `err` {Error} <ide> <del>Asynchronous mkdir(2). No arguments other than a possible exception are given <del>to the completion callback. `mode` defaults to `0o777`. <add>Asynchronously creates a directory. No arguments other than a possible exception <add>are given to the completion callback. `mode` defaults to `0o777`. <add> <add>See also: mkdir(2) <ide> <ide> ## fs.mkdirSync(path[, mode]) <ide> <!-- YAML <ide> changes: <ide> * `path` {string|Buffer|URL} <ide> * `mode` {integer} **Default:** `0o777` <ide> <del>Synchronous mkdir(2). Returns `undefined`. <add>Synchronously creates a directory. Returns `undefined`. <add>This is the synchronous version of [`fs.mkdir()`][]. <add> <add>See also: mkdir(2) <ide> <ide> ## fs.mkdtemp(prefix[, options], callback) <ide> <!-- YAML <ide> The following constants are meant for use with the [`fs.Stats`][] object's <ide> [`fs.Stats`]: #fs_class_fs_stats <ide> [`fs.access()`]: #fs_fs_access_path_mode_callback <ide> [`fs.appendFile()`]: fs.html#fs_fs_appendfile_file_data_options_callback <add>[`fs.chmod()`]: #fs_fs_chmod_path_mode_callback <add>[`fs.chown()`]: #fs_fs_chown_path_uid_gid_callback <ide> [`fs.exists()`]: fs.html#fs_fs_exists_path_callback <ide> [`fs.fstat()`]: #fs_fs_fstat_fd_callback <ide> [`fs.futimes()`]: #fs_fs_futimes_fd_atime_mtime_callback <ide> [`fs.lstat()`]: #fs_fs_lstat_path_callback <add>[`fs.mkdir()`]: #fs_fs_mkdir_path_mode_callback <ide> [`fs.mkdtemp()`]: #fs_fs_mkdtemp_prefix_options_callback <ide> [`fs.open()`]: #fs_fs_open_path_flags_mode_callback <ide> [`fs.read()`]: #fs_fs_read_fd_buffer_offset_length_position_callback
1
PHP
PHP
remove type as a separarte option
d83c3050a847740325c52e2a1fbbaffa25bc39b3
<ide><path>src/View/Widget/Button.php <ide> public function render(array $data) { <ide> ]; <ide> return $this->_templates->format('button', [ <ide> 'text' => $data['escape'] ? h($data['text']) : $data['text'], <del> 'type' => $data['type'], <del> 'attrs' => $this->_templates->formatAttributes($data, ['type', 'text']), <add> 'attrs' => $this->_templates->formatAttributes($data, ['text']), <ide> ]); <ide> } <ide> <ide><path>tests/TestCase/View/Widget/ButtonTest.php <ide> class ButtonTest extends TestCase { <ide> public function setUp() { <ide> parent::setUp(); <ide> $templates = [ <del> 'button' => '<button type="{{type}}"{{attrs}}>{{text}}</button>', <add> 'button' => '<button{{attrs}}>{{text}}</button>', <ide> ]; <ide> $this->templates = new StringTemplate($templates); <ide> }
2
Text
Text
add missing punctuation in web streams doc
3ac7f86c2bbd50ebcebb323c3b545f35b1350ebc
<ide><path>doc/api/webstreams.md <ide> streaming data. It is similar to the Node.js [Streams][] API but emerged later <ide> and has become the "standard" API for streaming data across many JavaScript <ide> environments. <ide> <del>There are three primary types of objects <add>There are three primary types of objects: <ide> <ide> * `ReadableStream` - Represents a source of streaming data. <ide> * `WritableStream` - Represents a destination for streaming data.
1
Javascript
Javascript
add jest mock for 'pushnotificationmanager'
31a0b8788f5f1fcb15a002746a345ae059e58b45
<ide><path>jest/setup.js <ide> const mockNativeModules = { <ide> addListener: jest.fn(), <ide> removeListeners: jest.fn(), <ide> }, <add> PushNotificationManager: { <add> presentLocalNotification: jest.fn(), <add> scheduleLocalNotification: jest.fn(), <add> cancelAllLocalNotifications: jest.fn(), <add> removeAllDeliveredNotifications: jest.fn(), <add> getDeliveredNotifications: jest.fn(callback => process.nextTick(() => [])), <add> removeDeliveredNotifications: jest.fn(), <add> setApplicationIconBadgeNumber: jest.fn(), <add> getApplicationIconBadgeNumber: jest.fn(callback => process.nextTick(() => callback(0))), <add> cancelLocalNotifications: jest.fn(), <add> getScheduledLocalNotifications: jest.fn(callback => process.nextTick(() => callback())), <add> requestPermissions: jest.fn(() => Promise.resolve({alert: true, badge: true, sound: true})), <add> abandonPermissions: jest.fn(), <add> checkPermissions: jest.fn(callback => process.nextTick(() => callback({alert: true, badge: true, sound: true}))), <add> getInitialNotification: jest.fn(() => Promise.resolve(null)), <add> addListener: jest.fn(), <add> removeListeners: jest.fn(), <add> }, <ide> SourceCode: { <ide> scriptURL: null, <ide> },
1
Javascript
Javascript
fix typo in bridge.js
46926993fc435e9ba7dd03f791ded05e32897b0d
<ide><path>packages/react-devtools-shared/src/bridge.js <ide> type FrontendEvents = {| <ide> // but the new frontend still dispatches them (in case older backends are listening to them instead). <ide> // <ide> // Note that this approach does no support the combination of a newer backend with an older frontend. <del> // It would be more work to suppot both approaches (and not run handlers twice) <add> // It would be more work to support both approaches (and not run handlers twice) <ide> // so I chose to support the more likely/common scenario (and the one more difficult for an end user to "fix"). <ide> overrideContext: [OverrideValue], <ide> overrideHookState: [OverrideHookState],
1
Text
Text
remove legacy mysql from guides to match
8c629bf463b47643712570d4511a68b9a3da1476
<ide><path>guides/source/contributing_to_ruby_on_rails.md <ide> $ bundle exec rake test:sqlite3 <ide> You can now run the tests as you did for `sqlite3`. The tasks are respectively: <ide> <ide> ```bash <del>test:mysql <ide> test:mysql2 <ide> test:postgresql <ide> ``` <ide><path>guides/source/development_dependencies_install.md <ide> $ bundle exec ruby -Itest path/to/test.rb -n test_name <ide> <ide> ### Active Record Setup <ide> <del>The test suite of Active Record attempts to run four times: once for SQLite3, once for each of the two MySQL gems (`mysql` and `mysql2`), and once for PostgreSQL. We are going to see now how to set up the environment for them. <add>Active Record's test suite runs three times: once for SQLite3, once for MySQL, and once for PostgreSQL. We are going to see now how to set up the environment for them. <ide> <ide> WARNING: If you're working with Active Record code, you _must_ ensure that the tests pass for at least MySQL, PostgreSQL, and SQLite3. Subtle differences between the various adapters have been behind the rejection of many patches that looked OK when tested only against MySQL. <ide>
2
PHP
PHP
remove use of options key in paginatorhelper
f8663154eef4f0aaef208a4e9ae2fb63439a899e
<ide><path>Cake/View/Helper/PaginatorHelper.php <ide> * <ide> * PaginationHelper encloses all methods needed when working with pagination. <ide> * <del> * @package Cake.View.Helper <ide> * @property HtmlHelper $Html <ide> * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html <ide> */ <ide> class PaginatorHelper extends Helper { <ide> * <ide> * @var array <ide> */ <del> public $options = array( <del> 'convertKeys' => array('page', 'limit', 'sort', 'direction') <del> ); <add> public $options = []; <ide> <ide> /** <ide> * Before render callback. Overridden to merge passed args with url options. <ide> public function options($options = array()) { <ide> ); <ide> unset($options[$model]); <ide> } <del> if (!empty($options['convertKeys'])) { <del> $options['convertKeys'] = array_merge($this->options['convertKeys'], $options['convertKeys']); <del> } <ide> $this->options = array_filter(array_merge($this->options, $options)); <ide> } <ide> <ide> public function current($model = null) { <ide> */ <ide> public function sortKey($model = null, $options = array()) { <ide> if (empty($options)) { <del> $params = $this->params($model); <del> $options = $params['options']; <add> $options = $this->params($model); <ide> } <del> if (isset($options['sort']) && !empty($options['sort'])) { <add> if (!empty($options['sort'])) { <ide> return $options['sort']; <ide> } <del> if (isset($options['order'])) { <del> return is_array($options['order']) ? key($options['order']) : $options['order']; <del> } <del> if (isset($params['order'])) { <del> return is_array($params['order']) ? key($params['order']) : $params['order']; <del> } <ide> return null; <ide> } <ide> <ide> public function sortDir($model = null, $options = array()) { <ide> $dir = null; <ide> <ide> if (empty($options)) { <del> $params = $this->params($model); <del> $options = $params['options']; <add> $options = $this->params($model); <ide> } <ide> <ide> if (isset($options['direction'])) { <ide> $dir = strtolower($options['direction']); <del> } elseif (isset($options['order']) && is_array($options['order'])) { <del> $dir = strtolower(current($options['order'])); <del> } elseif (isset($params['order']) && is_array($params['order'])) { <del> $dir = strtolower(current($params['order'])); <ide> } <ide> <ide> if ($dir === 'desc') { <ide> public function link($title, $url = array(), $options = array()) { <ide> $url = array_merge((array)$options['url'], (array)$url); <ide> unset($options['url']); <ide> } <del> unset($options['convertKeys']); <ide> <ide> $url = $this->url($url, true, $model); <ide> return $this->Html->link($title, $url, $options); <ide> public function link($title, $url = array(), $options = array()) { <ide> */ <ide> public function url($options = array(), $asArray = false, $model = null) { <ide> $paging = $this->params($model); <del> $url = array_merge(array_filter($paging['options']), $options); <add> $paging += ['page' => null, 'sort' => null, 'direction' => null, 'limit' => null]; <add> $url = [ <add> 'page' => $paging['page'], <add> 'sort' => $paging['sort'], <add> 'direction' => $paging['sort'], <add> 'limit' => $paging['limit'], <add> ]; <add> $url = array_merge(array_filter($url), $options); <ide> <del> if (isset($url['order'])) { <del> $sort = $direction = null; <del> if (is_array($url['order'])) { <del> list($sort, $direction) = array($this->sortKey($model, $url), current($url['order'])); <del> } <del> unset($url['order']); <del> $url = array_merge($url, compact('sort', 'direction')); <del> } <ide> if (!empty($url['page']) && $url['page'] == 1) { <ide> $url['page'] = null; <ide> }
1
PHP
PHP
try regexp as not all locales are available
89b2eddf0b54a88a5c48e13dd3b714d387b1ff5e
<ide><path>lib/Cake/Test/Case/Utility/CakeNumberTest.php <ide> public function testReadableSizeLocalized() { <ide> $restore = setlocale(LC_ALL, 0); <ide> setlocale(LC_ALL, 'de_DE'); <ide> $result = $this->Number->toReadableSize(1321205); <del> $this->assertEquals('1,26 MB', $result); <add> $this->assertRegExp('/1[,.]26 MB/', $result); <ide> <ide> $result = $this->Number->toReadableSize(1024 * 1024 * 1024 * 512); <del> $this->assertEquals('512,00 GB', $result); <add> $this->assertRegExp('/512[,.]00 GB/', $result); <ide> setlocale(LC_ALL, $restore); <ide> } <ide>
1
PHP
PHP
change auth to use short array syntax
9f7af57c281cc767dbf3407e56cbe917c9c3498a
<ide><path>src/Illuminate/Auth/DatabaseUserProvider.php <ide> public function updateRememberToken(UserContract $user, $token) <ide> { <ide> $this->conn->table($this->table) <ide> ->where('id', $user->getAuthIdentifier()) <del> ->update(array('remember_token' => $token)); <add> ->update(['remember_token' => $token]); <ide> } <ide> <ide> /** <ide><path>src/Illuminate/Auth/Guard.php <ide> protected function validRecaller($recaller) <ide> * @param array $credentials <ide> * @return bool <ide> */ <del> public function once(array $credentials = array()) <add> public function once(array $credentials = []) <ide> { <ide> if ($this->validate($credentials)) <ide> { <ide> public function once(array $credentials = array()) <ide> * @param array $credentials <ide> * @return bool <ide> */ <del> public function validate(array $credentials = array()) <add> public function validate(array $credentials = []) <ide> { <ide> return $this->attempt($credentials, false, false); <ide> } <ide> protected function attemptBasic(Request $request, $field) <ide> */ <ide> protected function getBasicCredentials(Request $request, $field) <ide> { <del> return array($field => $request->getUser(), 'password' => $request->getPassword()); <add> return [$field => $request->getUser(), 'password' => $request->getPassword()]; <ide> } <ide> <ide> /** <ide> protected function getBasicCredentials(Request $request, $field) <ide> */ <ide> protected function getBasicResponse() <ide> { <del> $headers = array('WWW-Authenticate' => 'Basic'); <add> $headers = ['WWW-Authenticate' => 'Basic']; <ide> <ide> return new Response('Invalid credentials.', 401, $headers); <ide> } <ide> protected function getBasicResponse() <ide> * @param bool $login <ide> * @return bool <ide> */ <del> public function attempt(array $credentials = array(), $remember = false, $login = true) <add> public function attempt(array $credentials = [], $remember = false, $login = true) <ide> { <ide> $this->fireAttemptEvent($credentials, $remember, $login); <ide> <ide> protected function fireAttemptEvent(array $credentials, $remember, $login) <ide> { <ide> if ($this->events) <ide> { <del> $payload = array($credentials, $remember, $login); <add> $payload = [$credentials, $remember, $login]; <ide> <ide> $this->events->fire('auth.attempt', $payload); <ide> } <ide> public function login(UserContract $user, $remember = false) <ide> // based on the login and logout events fired from the guard instances. <ide> if (isset($this->events)) <ide> { <del> $this->events->fire('auth.login', array($user, $remember)); <add> $this->events->fire('auth.login', [$user, $remember]); <ide> } <ide> <ide> $this->setUser($user); <ide> public function logout() <ide> <ide> if (isset($this->events)) <ide> { <del> $this->events->fire('auth.logout', array($user)); <add> $this->events->fire('auth.logout', [$user]); <ide> } <ide> <ide> // Once we have fired the logout event we will clear the users out of memory <ide><path>src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php <ide> protected function deleteExisting(CanResetPassword $user) <ide> */ <ide> protected function getPayload($email, $token) <ide> { <del> return array('email' => $email, 'token' => $token, 'created_at' => new Carbon); <add> return ['email' => $email, 'token' => $token, 'created_at' => new Carbon]; <ide> } <ide> <ide> /** <ide><path>src/Illuminate/Auth/Passwords/PasswordBroker.php <ide> protected function validatePasswordWithDefaults(array $credentials) <ide> */ <ide> public function getUser(array $credentials) <ide> { <del> $credentials = array_except($credentials, array('token')); <add> $credentials = array_except($credentials, ['token']); <ide> <ide> $user = $this->users->retrieveByCredentials($credentials); <ide> <ide><path>src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php <ide> protected function registerTokenRepository() <ide> */ <ide> public function provides() <ide> { <del> return array('auth.password', 'auth.password.tokens'); <add> return ['auth.password', 'auth.password.tokens']; <ide> } <ide> <ide> }
5
Python
Python
add network plugin
3366b421017805d767b306801c5ecb37026c1582
<ide><path>glances/core/glances_core.py <ide> print('PsUtil 0.5.1 or higher is needed. Glances cannot start.') <ide> sys.exit(1) <ide> <del>try: <del> # psutil.virtual_memory() only available from psutil >= 0.6 <del> psutil.virtual_memory() <del>except Exception: <del> psutil_mem_vm = False <del>else: <del> psutil_mem_vm = True <del> <ide> try: <ide> # psutil.net_io_counters() only available from psutil >= 1.0.0 <ide> psutil.net_io_counters() <ide><path>glances/plugins/glances_cpu.py <ide> from glances_plugin import GlancesPlugin <ide> <ide> class Plugin(GlancesPlugin): <del> """ <del> Glances' Cpu Plugin <add> """ <add> Glances' Cpu Plugin <ide> <del> stats is a dict <del> """ <add> stats is a dict <add> """ <ide> <del> def __init__(self): <del> GlancesPlugin.__init__(self) <add> def __init__(self): <add> GlancesPlugin.__init__(self) <ide> <ide> <del> def update(self): <del> """ <del> Update CPU stats <del> """ <add> def update(self): <add> """ <add> Update CPU stats <add> """ <ide> <del> # Grab CPU using the PSUtil cpu_times method <del> cputime = cpu_times(percpu=False) <del> cputime_total = cputime.user + cputime.system + cputime.idle <add> # Grab CPU using the PSUtil cpu_times method <add> cputime = cpu_times(percpu=False) <add> cputime_total = cputime.user + cputime.system + cputime.idle <ide> <del> # Only available on some OS <del> if hasattr(cputime, 'nice'): <del> cputime_total += cputime.nice <del> if hasattr(cputime, 'iowait'): <del> cputime_total += cputime.iowait <del> if hasattr(cputime, 'irq'): <del> cputime_total += cputime.irq <del> if hasattr(cputime, 'softirq'): <del> cputime_total += cputime.softirq <del> if hasattr(cputime, 'steal'): <del> cputime_total += cputime.steal <del> if not hasattr(self, 'cputime_old'): <del> self.cputime_old = cputime <del> self.cputime_total_old = cputime_total <del> self.stats = {} <del> else: <del> self.cputime_new = cputime <del> self.cputime_total_new = cputime_total <del> try: <del> percent = 100 / (self.cputime_total_new - <del> self.cputime_total_old) <del> self.stats = {'user': (self.cputime_new.user - <del> self.cputime_old.user) * percent, <del> 'system': (self.cputime_new.system - <del> self.cputime_old.system) * percent, <del> 'idle': (self.cputime_new.idle - <del> self.cputime_old.idle) * percent} <del> if hasattr(self.cputime_new, 'nice'): <del> self.stats['nice'] = (self.cputime_new.nice - <del> self.cputime_old.nice) * percent <del> if hasattr(self.cputime_new, 'iowait'): <del> self.stats['iowait'] = (self.cputime_new.iowait - <del> self.cputime_old.iowait) * percent <del> if hasattr(self.cputime_new, 'irq'): <del> self.stats['irq'] = (self.cputime_new.irq - <del> self.cputime_old.irq) * percent <del> if hasattr(self.cputime_new, 'softirq'): <del> self.stats['softirq'] = (self.cputime_new.softirq - <del> self.cputime_old.softirq) * percent <del> if hasattr(self.cputime_new, 'steal'): <del> self.stats['steal'] = (self.cputime_new.steal - <del> self.cputime_old.steal) * percent <del> self.cputime_old = self.cputime_new <del> self.cputime_total_old = self.cputime_total_new <del> except Exception, err: <del> self.stats = {} <add> # Only available on some OS <add> if hasattr(cputime, 'nice'): <add> cputime_total += cputime.nice <add> if hasattr(cputime, 'iowait'): <add> cputime_total += cputime.iowait <add> if hasattr(cputime, 'irq'): <add> cputime_total += cputime.irq <add> if hasattr(cputime, 'softirq'): <add> cputime_total += cputime.softirq <add> if hasattr(cputime, 'steal'): <add> cputime_total += cputime.steal <add> if not hasattr(self, 'cputime_old'): <add> self.cputime_old = cputime <add> self.cputime_total_old = cputime_total <add> self.stats = {} <add> else: <add> self.cputime_new = cputime <add> self.cputime_total_new = cputime_total <add> try: <add> percent = 100 / (self.cputime_total_new - <add> self.cputime_total_old) <add> self.stats = {'user': (self.cputime_new.user - <add> self.cputime_old.user) * percent, <add> 'system': (self.cputime_new.system - <add> self.cputime_old.system) * percent, <add> 'idle': (self.cputime_new.idle - <add> self.cputime_old.idle) * percent} <add> if hasattr(self.cputime_new, 'nice'): <add> self.stats['nice'] = (self.cputime_new.nice - <add> self.cputime_old.nice) * percent <add> if hasattr(self.cputime_new, 'iowait'): <add> self.stats['iowait'] = (self.cputime_new.iowait - <add> self.cputime_old.iowait) * percent <add> if hasattr(self.cputime_new, 'irq'): <add> self.stats['irq'] = (self.cputime_new.irq - <add> self.cputime_old.irq) * percent <add> if hasattr(self.cputime_new, 'softirq'): <add> self.stats['softirq'] = (self.cputime_new.softirq - <add> self.cputime_old.softirq) * percent <add> if hasattr(self.cputime_new, 'steal'): <add> self.stats['steal'] = (self.cputime_new.steal - <add> self.cputime_old.steal) * percent <add> self.cputime_old = self.cputime_new <add> self.cputime_total_old = self.cputime_total_new <add> except Exception, err: <add> self.stats = {} <ide><path>glances/plugins/glances_mem.py <add>#!/usr/bin/env python <add># -*- coding: utf-8 -*- <add># <add># Glances - An eye on your system <add># <add># Copyright (C) 2014 Nicolargo <nicolas@nicolargo.com> <add># <add># Glances is free software; you can redistribute it and/or modify <add># it under the terms of the GNU Lesser General Public License as published by <add># the Free Software Foundation, either version 3 of the License, or <add># (at your option) any later version. <add># <add># Glances is distributed in the hope that it will be useful, <add># but WITHOUT ANY WARRANTY; without even the implied warranty of <add># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <add># GNU Lesser General Public License for more details. <add># <add># You should have received a copy of the GNU Lesser General Public License <add># along with this program. If not, see <http://www.gnu.org/licenses/>. <add> <add># Import system libs <add># Check for PSUtil already done in the glances_core script <add>import psutil <add> <add># from ..plugins.glances_plugin import GlancesPlugin <add>from glances_plugin import GlancesPlugin <add> <add>class Plugin(GlancesPlugin): <add> """ <add> Glances's memory Plugin <add> <add> stats is a dict <add> """ <add> <add> def __init__(self): <add> GlancesPlugin.__init__(self) <add> <add> <add> def update(self): <add> """ <add> Update MEM (RAM) stats <add> """ <add> <add> # RAM <add> # psutil >= 0.6 <add> if hasattr(psutil, 'virtual_memory'): <add> phymem = psutil.virtual_memory() <add> <add> # buffers and cached (Linux, BSD) <add> buffers = getattr(phymem, 'buffers', 0) <add> cached = getattr(phymem, 'cached', 0) <add> <add> # active and inactive not available on Windows <add> active = getattr(phymem, 'active', 0) <add> inactive = getattr(phymem, 'inactive', 0) <add> <add> # phymem free and usage <add> total = phymem.total <add> free = phymem.available # phymem.free + buffers + cached <add> used = total - free <add> <add> self.stats = {'total': total, <add> 'percent': phymem.percent, <add> 'used': used, <add> 'free': free, <add> 'active': active, <add> 'inactive': inactive, <add> 'buffers': buffers, <add> 'cached': cached} <add> <add> # psutil < 0.6 <add> elif hasattr(psutil, 'phymem_usage'): <add> phymem = psutil.phymem_usage() <add> <add> # buffers and cached (Linux, BSD) <add> buffers = getattr(psutil, 'phymem_buffers', 0)() <add> cached = getattr(psutil, 'cached_phymem', 0)() <add> <add> # phymem free and usage <add> total = phymem.total <add> free = phymem.free + buffers + cached <add> used = total - free <add> <add> # active and inactive not available for psutil < 0.6 <add> self.stats = {'total': total, <add> 'percent': phymem.percent, <add> 'used': used, <add> 'free': free, <add> 'buffers': buffers, <add> 'cached': cached} <add> else: <add> self.stats = {} <ide><path>glances/plugins/glances_memswap.py <add>#!/usr/bin/env python <add># -*- coding: utf-8 -*- <add># <add># Glances - An eye on your system <add># <add># Copyright (C) 2014 Nicolargo <nicolas@nicolargo.com> <add># <add># Glances is free software; you can redistribute it and/or modify <add># it under the terms of the GNU Lesser General Public License as published by <add># the Free Software Foundation, either version 3 of the License, or <add># (at your option) any later version. <add># <add># Glances is distributed in the hope that it will be useful, <add># but WITHOUT ANY WARRANTY; without even the implied warranty of <add># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <add># GNU Lesser General Public License for more details. <add># <add># You should have received a copy of the GNU Lesser General Public License <add># along with this program. If not, see <http://www.gnu.org/licenses/>. <add> <add># Import system libs <add># Check for PSUtil already done in the glances_core script <add>import psutil <add> <add># from ..plugins.glances_plugin import GlancesPlugin <add>from glances_plugin import GlancesPlugin <add> <add>class Plugin(GlancesPlugin): <add> """ <add> Glances's swap memory Plugin <add> <add> stats is a dict <add> """ <add> <add> def __init__(self): <add> GlancesPlugin.__init__(self) <add> <add> <add> def update(self): <add> """ <add> Update MEM (SWAP) stats <add> """ <add> <add> # SWAP <add> # psutil >= 0.6 <add> if hasattr(psutil, 'swap_memory'): <add> # Try... is an hack for issue #152 <add> try: <add> virtmem = psutil.swap_memory() <add> except Exception: <add> self.stats = {} <add> else: <add> self.stats = {'total': virtmem.total, <add> 'used': virtmem.used, <add> 'free': virtmem.free, <add> 'percent': virtmem.percent} <add> <add> # psutil < 0.6 <add> elif hasattr(psutil, 'virtmem_usage'): <add> virtmem = psutil.virtmem_usage() <add> self.stats = {'total': virtmem.total, <add> 'used': virtmem.used, <add> 'free': virtmem.free, <add> 'percent': virtmem.percent} <add> else: <add> self.stats = {} <ide><path>glances/plugins/glances_network.py <add>#!/usr/bin/env python <add># -*- coding: utf-8 -*- <add># <add># Glances - An eye on your system <add># <add># Copyright (C) 2014 Nicolargo <nicolas@nicolargo.com> <add># <add># Glances is free software; you can redistribute it and/or modify <add># it under the terms of the GNU Lesser General Public License as published by <add># the Free Software Foundation, either version 3 of the License, or <add># (at your option) any later version. <add># <add># Glances is distributed in the hope that it will be useful, <add># but WITHOUT ANY WARRANTY; without even the implied warranty of <add># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <add># GNU Lesser General Public License for more details. <add># <add># You should have received a copy of the GNU Lesser General Public License <add># along with this program. If not, see <http://www.gnu.org/licenses/>. <add> <add># Import system libs <add># Check for PSUtil already done in the glances_core script <add>import psutil <add> <add>try: <add> # psutil.net_io_counters() only available from psutil >= 1.0.0 <add> psutil.net_io_counters() <add>except Exception: <add> psutil_net_io_counters = False <add>else: <add> psutil_net_io_counters = True <add> <add># from ..plugins.glances_plugin import GlancesPlugin <add>from glances_plugin import GlancesPlugin, getTimeSinceLastUpdate <add> <add>class Plugin(GlancesPlugin): <add> """ <add> Glances's network Plugin <add> <add> stats is a list <add> """ <add> <add> def __init__(self): <add> GlancesPlugin.__init__(self) <add> <add> <add> def update(self): <add> """ <add> Update network stats <add> """ <add> <add> # By storing time data we enable Rx/s and Tx/s calculations in the <add> # XML/RPC API, which would otherwise be overly difficult work <add> # for users of the API <add> time_since_update = getTimeSinceLastUpdate('net') <add> <add> if psutil_net_io_counters: <add> # psutil >= 1.0.0 <add> try: <add> get_net_io_counters = psutil.net_io_counters(pernic=True) <add> except IOError: <add> pass <add> else: <add> # psutil < 1.0.0 <add> try: <add> get_net_io_counters = psutil.network_io_counters(pernic=True) <add> except IOError: <add> pass <add> <add> network = [] <add> <add> # Previous network interface stats are stored in the network_old variable <add> if not hasattr(self, 'network_old'): <add> # First call, we init the network_old var <add> try: <add> self.network_old = get_net_io_counters <add> except (IOError, UnboundLocalError): <add> pass <add> else: <add> network_new = get_net_io_counters <add> for net in network_new: <add> try: <add> # Try necessary to manage dynamic network interface <add> netstat = {} <add> netstat['time_since_update'] = time_since_update <add> netstat['interface_name'] = net <add> netstat['cumulative_rx'] = network_new[net].bytes_recv <add> netstat['rx'] = (network_new[net].bytes_recv - <add> self.network_old[net].bytes_recv) <add> netstat['cumulative_tx'] = network_new[net].bytes_sent <add> netstat['tx'] = (network_new[net].bytes_sent - <add> self.network_old[net].bytes_sent) <add> netstat['cumulative_cx'] = (netstat['cumulative_rx'] + <add> netstat['cumulative_tx']) <add> netstat['cx'] = netstat['rx'] + netstat['tx'] <add> except Exception: <add> continue <add> else: <add> network.append(netstat) <add> self.network_old = network_new <add> <add> self.stats = network <ide><path>glances/plugins/glances_percpu.py <ide> from glances_plugin import GlancesPlugin <ide> <ide> class Plugin(GlancesPlugin): <del> """ <del> Glances' PerCpu Plugin <add> """ <add> Glances' PerCpu Plugin <ide> <del> stats is a list <del> """ <add> stats is a list <add> """ <ide> <del> def __init__(self): <del> GlancesPlugin.__init__(self) <add> def __init__(self): <add> GlancesPlugin.__init__(self) <ide> <ide> <del> def update(self): <del> """ <del> Update Per CPU stats <del> """ <add> def update(self): <add> """ <add> Update Per CPU stats <add> """ <ide> <del> # Grab CPU using the PSUtil cpu_times method <del> # Per-CPU <del> percputime = cpu_times(percpu=True) <del> percputime_total = [] <del> for i in range(len(percputime)): <del> percputime_total.append(percputime[i].user + <del> percputime[i].system + <del> percputime[i].idle) <del> <del> # Only available on some OS <del> for i in range(len(percputime)): <del> if hasattr(percputime[i], 'nice'): <del> percputime_total[i] += percputime[i].nice <del> for i in range(len(percputime)): <del> if hasattr(percputime[i], 'iowait'): <del> percputime_total[i] += percputime[i].iowait <del> for i in range(len(percputime)): <del> if hasattr(percputime[i], 'irq'): <del> percputime_total[i] += percputime[i].irq <del> for i in range(len(percputime)): <del> if hasattr(percputime[i], 'softirq'): <del> percputime_total[i] += percputime[i].softirq <del> for i in range(len(percputime)): <del> if hasattr(percputime[i], 'steal'): <del> percputime_total[i] += percputime[i].steal <del> if not hasattr(self, 'percputime_old'): <del> self.percputime_old = percputime <del> self.percputime_total_old = percputime_total <del> self.stats = [] <del> else: <del> self.percputime_new = percputime <del> self.percputime_total_new = percputime_total <del> perpercent = [] <del> self.stats = [] <del> try: <del> for i in range(len(self.percputime_new)): <del> perpercent.append(100 / (self.percputime_total_new[i] - <del> self.percputime_total_old[i])) <del> cpu = {'user': (self.percputime_new[i].user - <del> self.percputime_old[i].user) * perpercent[i], <del> 'system': (self.percputime_new[i].system - <del> self.percputime_old[i].system) * perpercent[i], <del> 'idle': (self.percputime_new[i].idle - <del> self.percputime_old[i].idle) * perpercent[i]} <del> if hasattr(self.percputime_new[i], 'nice'): <del> cpu['nice'] = (self.percputime_new[i].nice - <del> self.percputime_old[i].nice) * perpercent[i] <del> if hasattr(self.percputime_new[i], 'iowait'): <del> cpu['iowait'] = (self.percputime_new[i].iowait - <del> self.percputime_old[i].iowait) * perpercent[i] <del> if hasattr(self.percputime_new[i], 'irq'): <del> cpu['irq'] = (self.percputime_new[i].irq - <del> self.percputime_old[i].irq) * perpercent[i] <del> if hasattr(self.percputime_new[i], 'softirq'): <del> cpu['softirq'] = (self.percputime_new[i].softirq - <del> self.percputime_old[i].softirq) * perpercent[i] <del> if hasattr(self.percputime_new[i], 'steal'): <del> cpu['steal'] = (self.percputime_new[i].steal - <del> self.percputime_old[i].steal) * perpercent[i] <del> self.stats.append(cpu) <del> self.percputime_old = self.percputime_new <del> self.percputime_total_old = self.percputime_total_new <del> except Exception, err: <del> self.stats = [] <add> # Grab CPU using the PSUtil cpu_times method <add> # Per-CPU <add> percputime = cpu_times(percpu=True) <add> percputime_total = [] <add> for i in range(len(percputime)): <add> percputime_total.append(percputime[i].user + <add> percputime[i].system + <add> percputime[i].idle) <add> <add> # Only available on some OS <add> for i in range(len(percputime)): <add> if hasattr(percputime[i], 'nice'): <add> percputime_total[i] += percputime[i].nice <add> for i in range(len(percputime)): <add> if hasattr(percputime[i], 'iowait'): <add> percputime_total[i] += percputime[i].iowait <add> for i in range(len(percputime)): <add> if hasattr(percputime[i], 'irq'): <add> percputime_total[i] += percputime[i].irq <add> for i in range(len(percputime)): <add> if hasattr(percputime[i], 'softirq'): <add> percputime_total[i] += percputime[i].softirq <add> for i in range(len(percputime)): <add> if hasattr(percputime[i], 'steal'): <add> percputime_total[i] += percputime[i].steal <add> if not hasattr(self, 'percputime_old'): <add> self.percputime_old = percputime <add> self.percputime_total_old = percputime_total <add> self.stats = [] <add> else: <add> self.percputime_new = percputime <add> self.percputime_total_new = percputime_total <add> perpercent = [] <add> self.stats = [] <add> try: <add> for i in range(len(self.percputime_new)): <add> perpercent.append(100 / (self.percputime_total_new[i] - <add> self.percputime_total_old[i])) <add> cpu = {'user': (self.percputime_new[i].user - <add> self.percputime_old[i].user) * perpercent[i], <add> 'system': (self.percputime_new[i].system - <add> self.percputime_old[i].system) * perpercent[i], <add> 'idle': (self.percputime_new[i].idle - <add> self.percputime_old[i].idle) * perpercent[i]} <add> if hasattr(self.percputime_new[i], 'nice'): <add> cpu['nice'] = (self.percputime_new[i].nice - <add> self.percputime_old[i].nice) * perpercent[i] <add> if hasattr(self.percputime_new[i], 'iowait'): <add> cpu['iowait'] = (self.percputime_new[i].iowait - <add> self.percputime_old[i].iowait) * perpercent[i] <add> if hasattr(self.percputime_new[i], 'irq'): <add> cpu['irq'] = (self.percputime_new[i].irq - <add> self.percputime_old[i].irq) * perpercent[i] <add> if hasattr(self.percputime_new[i], 'softirq'): <add> cpu['softirq'] = (self.percputime_new[i].softirq - <add> self.percputime_old[i].softirq) * perpercent[i] <add> if hasattr(self.percputime_new[i], 'steal'): <add> cpu['steal'] = (self.percputime_new[i].steal - <add> self.percputime_old[i].steal) * perpercent[i] <add> self.stats.append(cpu) <add> self.percputime_old = self.percputime_new <add> self.percputime_total_old = self.percputime_total_new <add> except Exception, err: <add> self.stats = [] <ide><path>glances/plugins/glances_plugin.py <ide> # You should have received a copy of the GNU Lesser General Public License <ide> # along with this program. If not, see <http://www.gnu.org/licenses/>. <ide> <add>from time import time <add> <add>last_update_times = {} <add> <add>def getTimeSinceLastUpdate(IOType): <add> global last_update_times <add> # assert(IOType in ['net', 'disk', 'process_disk']) <add> current_time = time() <add> last_time = last_update_times.get(IOType) <add> if not last_time: <add> time_since_update = 1 <add> else: <add> time_since_update = current_time - last_time <add> last_update_times[IOType] = current_time <add> return time_since_update <add> <add> <ide> class GlancesPlugin(object): <ide> """ <ide> Main class for Glances' plugin <ide> def __str__(self): <ide> return str(self.stats) <ide> <ide> def get_stats(self): <del> # Return the stats object <del> return self.stats <add> # Return the stats object for the RPC API <add> # Had to convert it to string <add> return str(self.stats)
7
Javascript
Javascript
add support for light probes
ba2ed44da63e1629a8b70cac22ff90c1a75655a8
<ide><path>src/Three.js <ide> export { DirectionalLight } from './lights/DirectionalLight.js'; <ide> export { AmbientLight } from './lights/AmbientLight.js'; <ide> export { LightShadow } from './lights/LightShadow.js'; <ide> export { Light } from './lights/Light.js'; <add>export { LightProbe } from './lights/LightProbe.js'; <ide> export { StereoCamera } from './cameras/StereoCamera.js'; <ide> export { PerspectiveCamera } from './cameras/PerspectiveCamera.js'; <ide> export { OrthographicCamera } from './cameras/OrthographicCamera.js'; <ide> export { Vector3 } from './math/Vector3.js'; <ide> export { Vector2 } from './math/Vector2.js'; <ide> export { Quaternion } from './math/Quaternion.js'; <ide> export { Color } from './math/Color.js'; <add>export { SphericalHarmonics3 } from './math/SphericalHarmonics3.js'; <ide> export { ImmediateRenderObject } from './extras/objects/ImmediateRenderObject.js'; <ide> export { VertexNormalsHelper } from './helpers/VertexNormalsHelper.js'; <ide> export { SpotLightHelper } from './helpers/SpotLightHelper.js'; <ide><path>src/renderers/WebGLRenderer.js <ide> function WebGLRenderer( parameters ) { <ide> // wire up the material to this renderer's lighting state <ide> <ide> uniforms.ambientLightColor.value = lights.state.ambient; <add> uniforms.lightProbe.value = lights.state.probe; <ide> uniforms.directionalLights.value = lights.state.directional; <ide> uniforms.spotLights.value = lights.state.spot; <ide> uniforms.rectAreaLights.value = lights.state.rectArea; <ide> function WebGLRenderer( parameters ) { <ide> function markUniformsLightsNeedsUpdate( uniforms, value ) { <ide> <ide> uniforms.ambientLightColor.needsUpdate = value; <add> uniforms.lightProbe.needsUpdate = value; <ide> <ide> uniforms.directionalLights.needsUpdate = value; <ide> uniforms.pointLights.needsUpdate = value; <ide><path>src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js <ide> IncidentLight directLight; <ide> <ide> vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); <ide> <add> irradiance += getLightProbeIrradiance( lightProbe, geometry ); <add> <ide> #if ( NUM_HEMI_LIGHTS > 0 ) <ide> <ide> #pragma unroll_loop <ide><path>src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js <ide> export default /* glsl */` <ide> uniform vec3 ambientLightColor; <add>uniform vec3 lightProbe[ 9 ]; <add> <add>// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere <add>// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf <add>vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { <add> <add> // normal is assumed to have unit length <add> <add> float x = normal.x, y = normal.y, z = normal.z; <add> <add> // band 0 <add> vec3 result = shCoefficients[ 0 ] * 0.886227; <add> <add> // band 1 <add> result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; <add> result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; <add> result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; <add> <add> // band 2 <add> result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; <add> result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; <add> result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); <add> result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; <add> result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); <add> <add> return result; <add> <add>} <add> <add>vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { <add> <add> vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); <add> <add> vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); <add> <add> return irradiance; <add> <add>} <ide> <ide> vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { <ide> <ide><path>src/renderers/shaders/UniformsLib.js <ide> var UniformsLib = { <ide> <ide> ambientLightColor: { value: [] }, <ide> <add> lightProbe: { value: [] }, <add> <ide> directionalLights: { value: [], properties: { <ide> direction: {}, <ide> color: {}, <ide><path>src/renderers/webgl/WebGLLights.js <ide> function WebGLLights() { <ide> }, <ide> <ide> ambient: [ 0, 0, 0 ], <add> probe: [], <ide> directional: [], <ide> directionalShadowMap: [], <ide> directionalShadowMatrix: [], <ide> function WebGLLights() { <ide> <ide> }; <ide> <add> for ( var i = 0; i < 9; i ++ ) state.probe.push( new Vector3() ); <add> <ide> var vector3 = new Vector3(); <ide> var matrix4 = new Matrix4(); <ide> var matrix42 = new Matrix4(); <ide> function WebGLLights() { <ide> <ide> var r = 0, g = 0, b = 0; <ide> <add> for ( var i = 0; i < 9; i ++ ) state.probe[ i ].set( 0, 0, 0 ); <add> <ide> var directionalLength = 0; <ide> var pointLength = 0; <ide> var spotLength = 0; <ide> function WebGLLights() { <ide> g += color.g * intensity; <ide> b += color.b * intensity; <ide> <add> } else if ( light.isLightProbe ) { <add> <add> for ( var j = 0; j < 9; j ++ ) { <add> <add> state.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity ); <add> <add> } <add> <ide> } else if ( light.isDirectionalLight ) { <ide> <ide> var uniforms = cache.get( light );
6
Javascript
Javascript
adjust jpeg quality when generating placeholder
ab450aaa1e0a741cd1dd8cef0ff14dba3ce64027
<ide><path>packages/next/build/webpack/loaders/next-image-loader.js <ide> import loaderUtils from 'next/dist/compiled/loader-utils' <ide> import sizeOf from 'image-size' <ide> import { processBuffer } from '../../../next-server/server/lib/squoosh/main' <ide> <del>const PLACEHOLDER_SIZE = 6 <add>const PLACEHOLDER_SIZE = 8 <ide> <ide> async function nextImageLoader(content) { <ide> const context = this.rootContext <ide> async function nextImageLoader(content) { <ide> content, <ide> [resizeOperationOpts], <ide> extension, <del> 0 <add> 70 <ide> ) <ide> placeholder = `data:image/${extension};base64,${resizedImage.toString( <ide> 'base64' <ide><path>test/integration/image-component/default/test/static.test.js <ide> const runTests = () => { <ide> }) <ide> it('Should add a blurry placeholder to statically imported jpg', async () => { <ide> expect(html).toContain( <del> `style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;background-size:cover;background-image:url(&quot;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wEEEAMgAyADIAMgA1IDIAOEA+gD6AOEBOIFRgSwBUYE4gc6BqQGDgYOBqQHOgrwB9AIZgfQCGYH0ArwEJoKWgwcCloKWgwcCloQmg6mEcYOdA16DnQRxg6mGl4UtBJcElwUtBpeHngZlhg4GZYeeCTqIQIhAiTqLnwsJC58PL48vlGkEQMgAyADIAMgA1IDIAOEA+gD6AOEBOIFRgSwBUYE4gc6BqQGDgYOBqQHOgrwB9AIZgfQCGYH0ArwEJoKWgwcCloKWgwcCloQmg6mEcYOdA16DnQRxg6mGl4UtBJcElwUtBpeHngZlhg4GZYeeCTqIQIhAiTqLnwsJC58PL48vlGk/8IAEQgABgAGAwEiAAIRAQMRAf/EABQAAQAAAAAAAAAAAAAAAAAAAAH/2gAIAQEAAAAAP//EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIQAAAAf//EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMQAAAAf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8Af//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Af//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Af//Z&quot;)"` <add> `style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;background-size:cover;background-image:url(&quot;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/sBCgoKCgoKCwwMCw8QDhAPFhQTExQWIhgaGBoYIjMgJSAgJSAzLTcsKSw3LVFAODhAUV5PSk9ecWVlcY+Ij7u7+//CABEIAAgACAMBIgACEQEDEQH/xAAUAAEAAAAAAAAAAAAAAAAAAAAH/9oACAEBAAAAADX/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oACAECEAAAAH//xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oACAEDEAAAAH//xAAdEAABAgcAAAAAAAAAAAAAAAATEhUAAwUUIzLS/9oACAEBAAE/AB0ZlUac43GqMYuo/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAgEBPwB//8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAwEBPwB//9k=&quot;)"` <ide> ) <ide> }) <ide> it('Should add a blurry placeholder to statically imported png', async () => { <ide> expect(html).toContain( <del> `style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;background-size:cover;background-image:url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAQAAABKxSfDAAAAOklEQVR42jXLsQ2AMADEQINYIT2ZgP2VfTLGmy+gObkxeImfhyXU1pSsrDoDPm53RfDOyKiE839y+gIFlSgsTCgClAAAAABJRU5ErkJggg==&quot;)"` <add> `style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;background-size:cover;background-image:url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAQAAABuBnYAAAAATklEQVR42i2I0QmAMBQD869Q9K+IsxU6RkfoiA6T55VXDpJLJC9uUJIzcx+XFd2dXMbx8n+QpoeYDpgY66RaDA83jCUfVpK2pER1dcEUP+KfSBtXK+BpAAAAAElFTkSuQmCC&quot;)"` <ide> ) <ide> }) <ide> }
2
Ruby
Ruby
apply suggestions from code review
889b30b32e6b0d8d6bfccbd28a557c66121fa7a6
<ide><path>Library/Homebrew/tap.rb <ide> def install(quiet: false, clone_target: nil, force_auto_update: nil, custom_remo <ide> remote = Homebrew::EnvConfig.core_git_remote <ide> requested_remote = clone_target || default_remote <ide> <del> # The remote will changed again on `brew update` since remotes for Homebrew/core are mismatch <add> # The remote will changed again on `brew update` since remotes for Homebrew/core are mismatched <ide> raise TapCoreRemoteMismatchError.new(name, remote, requested_remote) if requested_remote != remote <ide> <ide> if remote != default_remote
1
Python
Python
remove the `np.typing._arrayorscalar` type-alias
a90cbc7476902811f94044cbfedaeb6bbcd17413
<ide><path>numpy/typing/__init__.py <ide> class _8Bit(_16Bit): ... # type: ignore[misc] <ide> _RecursiveSequence, <ide> _SupportsArray, <ide> _ArrayND, <del> _ArrayOrScalar, <ide> _ArrayLikeInt, <ide> _ArrayLikeBool_co, <ide> _ArrayLikeUInt_co, <ide><path>numpy/typing/_array_like.py <ide> def __array__(self) -> ndarray[Any, _DType_co]: ... <ide> <ide> if TYPE_CHECKING: <ide> _ArrayND = ndarray[Any, dtype[_ScalarType]] <del> _ArrayOrScalar = Union[_ScalarType, _ArrayND[_ScalarType]] <ide> else: <ide> _ArrayND = Any <del> _ArrayOrScalar = Any
2
Text
Text
add example for unset! directive
9e20cefd4bd91af83787457f3bd849713c0e8918
<ide><path>docs/advanced/keymaps.md <ide> the current keystroke sequence and continue searching from its parent. If you <ide> want to remove a binding from a keymap you don't control, such as keymaps in <ide> Atom core or in packages, use the `unset!` directive. <ide> <add>```coffee <add># remove the 'a' keybinding in the Tree View, which is <add># normally bound to the tree-view:add-file command <add> <add>'.tree-view': <add> 'a': 'unset!' <add>``` <add> <add>![](https://cloud.githubusercontent.com/assets/38924/3174771/e7f6ce64-ebf4-11e3-922d-f280bffb3fc5.png) <add> <ide> ## Forcing Chromium's Native Keystroke Handling <ide> <ide> If you want to force the native browser behavior for a given keystroke, use the
1
PHP
PHP
fix missing newline
ac195be7dfb56247cf14cdb3b6d6214ed0aae402
<ide><path>src/Error/ExceptionRenderer.php <ide> protected function _customMethod($method, $exception) <ide> <ide> return $result; <ide> } <add> <ide> /** <ide> * Get method name <ide> *
1
Ruby
Ruby
change table to prevent copying indexes on sqlite2
2e6d1bf43e162026307141806e04b4d62e40a2f8
<ide><path>activerecord/test/cases/copy_table_test_sqlite.rb <ide> class << @connection <ide> end <ide> end <ide> <del> def test_copy_table(from = 'companies', to = 'companies2', options = {}) <add> def test_copy_table(from = 'customers', to = 'customers2', options = {}) <ide> assert_nothing_raised {copy_table(from, to, options)} <ide> assert_equal row_count(from), row_count(to) <ide> <ide> def test_copy_table(from = 'companies', to = 'companies2', options = {}) <ide> end <ide> <ide> def test_copy_table_renaming_column <del> test_copy_table('companies', 'companies2', <del> :rename => {'client_of' => 'fan_of'}) do |from, to, options| <del> expected = column_values(from, 'client_of') <add> test_copy_table('customers', 'customers2', <add> :rename => {'name' => 'person_name'}) do |from, to, options| <add> expected = column_values(from, 'name') <ide> assert expected.any?, 'only nils in resultset; real values are needed' <del> assert_equal expected, column_values(to, 'fan_of') <add> assert_equal expected, column_values(to, 'person_name') <ide> end <ide> end <ide>
1
Python
Python
remove unneeded steps_per_epoch
bc285462ad8ec9b8bc00bd6e09f9bcd9ae3d84a2
<ide><path>examples/cifar10_cnn.py <ide> from keras.models import Sequential <ide> from keras.layers import Dense, Dropout, Activation, Flatten <ide> from keras.layers import Conv2D, MaxPooling2D <del>import numpy as np <ide> import os <ide> <ide> batch_size = 32 <ide> # Fit the model on the batches generated by datagen.flow(). <ide> model.fit_generator(datagen.flow(x_train, y_train, <ide> batch_size=batch_size), <del> steps_per_epoch=int(np.ceil(x_train.shape[0] / float(batch_size))), <ide> epochs=epochs, <ide> validation_data=(x_test, y_test), <ide> workers=4) <ide><path>examples/cifar10_resnet.py <ide> def resnet_v2(input_shape, depth, num_classes=10): <ide> datagen.fit(x_train) <ide> <ide> # Fit the model on the batches generated by datagen.flow(). <del> steps_per_epoch = int(np.ceil(x_train.shape[0] / float(batch_size))) <ide> model.fit_generator(datagen.flow(x_train, y_train, batch_size=batch_size), <del> steps_per_epoch=steps_per_epoch, <ide> validation_data=(x_test, y_test), <ide> epochs=epochs, verbose=1, workers=4, <ide> callbacks=callbacks)
2
Text
Text
expand the responsible disclosure
9b15d47566dbb93314c7ac19446f74f906be6f80
<ide><path>docs/_sidebar.md <ide> - **Getting Started** <ide> - [Introduction](index.md 'Contribute to the freeCodeCamp.org Community') <ide> - [Frequently Asked Questions](FAQ.md) <add> - [Reporting a Vulnerability](security.md) <ide> - **Translation Contribution** <ide> - [Work on translating resources](how-to-translate-files.md) <ide> - [Work on proofreading translations](how-to-proofread-files.md) <ide><path>docs/security-hall-of-fame.md <ide> # Responsible Disclosure - Hall of Fame <ide> <del>We appreciate any responsible disclosure of vulnerabilities that might impact the integrity of our platforms and users. <add>We appreciate any responsible disclosure of vulnerabilities that might impact the integrity of our platforms and users. If you are interested in contributing to the security of our platform, please read our [security policy outlined here](https://contribute.freecodecamp.org/#/security). <ide> <ide> While we do not offer any bounties or swags at the moment, we are grateful to these awesome people for helping us keep the platform safe for everyone: <ide> <ide> - Mehul Mohan from [codedamn](https://codedamn.com) ([@mehulmpt](https://twitter.com/mehulmpt)) - [Vulnerability Fix](https://github.com/freeCodeCamp/freeCodeCamp/blob/bb5a9e815313f1f7c91338e171bfe5acb8f3e346/client/src/components/Flash/index.js) <ide> - Peter Samir https://www.linkedin.com/in/peter-samir/ <ide> <ide> > ### Thank you for your contributions :pray: <del> <del>If you are interested in contributing to the security of our platform, please read our [security policy outlined here](https://contribute.freecodecamp.org/#/security). <ide><path>docs/security.md <ide> # Security Policy <ide> <del>This document outlines our security policy for the codebase, and how to report vulnerabilities. <del> <del>## Versions <del> <del>| Version | Branch | Supported | Website active | <del>| ----------- | -------------- | ------------------ | ---------------- | <del>| production | `prod-current` | :white_check_mark: | freecodecamp.org | <del>| beta | `prod-staging` | :white_check_mark: | freecodecamp.dev | <del>| development | `main` | | | <add>This document outlines our security policy for the codebases, platforms that we operate, and how to report vulnerabilities. <ide> <ide> ## Reporting a Vulnerability <ide> <ide> If you think you have found a vulnerability, _please report responsibly_. Don't create GitHub issues for security issues. Instead, please send an email to `security@freecodecamp.org` and we'll look into it immediately. <ide> <add>Ensure that you are using the **latest**, **stable** and **updated** version of the Operating System and Web Browser available to you on your machine. <add> <ide> We appreciate any responsible disclosure of vulnerabilities that might impact the integrity of our platforms and users. <ide> <del>While we do not offer any bounties or swags at the moment, we'll be happy to list your name in our [Hall of Fame](https://contribute.freecodecamp.org/#/security-hall-of-fame) list, provided the reports are not low-effort for example: using tools & online utilities to report SFP configurations, or SSL Server tests, etc. We consider those in the category of ["beg bounties"](https://www.troyhunt.com/beg-bounties/). <add>Once you report a vulnerability, we will look into it and make sure that it is not a false positive. We will get back to you if we need to clarify any details. You can submit separate reports for each issue you find. <ide> <del>Ensure that you are using the **latest**, **stable** and **updated** version of the Operating System and Web Browser available to you on your machine. <add>While we do not offer any bounties or swags at the moment, we'll be happy to list your name in our [Hall of Fame](https://contribute.freecodecamp.org/#/security-hall-of-fame) list, provided the reports are not low-effort. <add> <add>We consider using tools & online utilities to report issues with SPF & DKIM configs, or SSL Server tests, etc. in the category of ["beg bounties"](https://www.troyhunt.com/beg-bounties/) and are unable to respond to these reports. <add> <add>## Platforms & Codebases <add> <add>Here is a list of the platforms and codebases we are accepting reports for: <add> <add>### Learn Platform <add> <add>| Version | Branch | Supported | Website active | <add>| ----------- | -------------- | --------- | ------------------------ | <add>| production | `prod-current` | Yes | `freecodecamp.org/learn` | <add>| staging | `prod-staging` | Yes | `freecodecamp.dev/learn` | <add>| development | `main` | No | | <add> <add>### Publication Platform <add> <add>| Version | Supported | Website active | <add>| ---------- | --------- | ---------------------------------- | <add>| production | Yes | `freecodecamp.org/news` | <add>| localized | Yes | `freecodecamp.org/<language>/news` | <add> <add>### Mobile app <add> <add>| Version | Supported | Website active | <add>| ---------- | --------- | ---------------------------------------------------------------- | <add>| production | Yes | `https://play.google.com/store/apps/details?id=org.freecodecamp` | <add> <add>Apart from the above, we are also accepting reports for repositories hosted on GitHub, under the freeCodeCamp organization. <add> <add>We self-host some of our platforms using open-source software like Ghost & Discourse. If you are reporting a vulnerability please ensure that it is not a bug in the upstream software.
3
Text
Text
add missing closing bracket
d88f484e895e62b7583c7ff8d7959ba00bec968d
<ide><path>docs/advanced-features/security-headers.md <ide> async headers() { <ide> source: '/(.*)', <ide> headers: securityHeaders <ide> } <add> ] <ide> } <ide> ``` <ide>
1
PHP
PHP
allow plain boolean into when and skip
1d1a96e405fec58fd287940f005bd8e40d4e546b
<ide><path>src/Illuminate/Console/Scheduling/Event.php <ide> public function withoutOverlapping() <ide> /** <ide> * Register a callback to further filter the schedule. <ide> * <del> * @param \Closure $callback <add> * @param \Closure|boolean $callback <ide> * @return $this <ide> */ <del> public function when(Closure $callback) <add> public function when($callback) <ide> { <del> $this->filters[] = $callback; <add> $this->filters[] = is_callable($callback) ? $callback : function () use ($callback) { <add> return $callback; <add> }; <ide> <ide> return $this; <ide> } <ide> <ide> /** <ide> * Register a callback to further filter the schedule. <ide> * <del> * @param \Closure $callback <add> * @param \Closure|boolean $callback <ide> * @return $this <ide> */ <del> public function skip(Closure $callback) <add> public function skip($callback) <ide> { <del> $this->rejects[] = $callback; <add> $this->rejects[] = is_callable($callback) ? $callback : function () use ($callback) { <add> return $callback; <add> }; <ide> <ide> return $this; <ide> } <ide><path>tests/Console/ConsoleScheduledEventTest.php <ide> public function testBasicCronCompilation() <ide> return false; <ide> })->filtersPass($app)); <ide> <add> $event = new Event(m::mock('Illuminate\Console\Scheduling\Mutex'), 'php foo'); <add> $this->assertEquals('* * * * * *', $event->getExpression()); <add> $this->assertFalse($event->when(false)->filtersPass($app)); <add> <ide> // chained rules should be commutative <ide> $eventA = new Event(m::mock('Illuminate\Console\Scheduling\Mutex'), 'php foo'); <ide> $eventB = new Event(m::mock('Illuminate\Console\Scheduling\Mutex'), 'php foo');
2
Javascript
Javascript
remove unnecessary warning for invalid node
df0532b0c38fc3579a9993ea58abd5ed33cd16a6
<ide><path>src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js <ide> describe('ReactStatelessComponent', () => { <ide> ); <ide> }); <ide> <del> it('should warn when stateless component returns array', () => { <del> spyOn(console, 'error'); <add> it('should throw when stateless component returns array', () => { <ide> function NotAComponent() { <ide> return [<div />, <div />]; <ide> } <ide> expect(function() { <ide> ReactTestUtils.renderIntoDocument(<div><NotAComponent /></div>); <del> }).toThrow(); <del> expectDev(console.error.calls.count()).toBe(1); <del> expectDev(console.error.calls.argsFor(0)[0]).toContain( <add> }).toThrowError( <ide> 'NotAComponent(...): A valid React element (or null) must be returned. ' + <ide> 'You may have returned undefined, an array or some other invalid object.' <ide> ); <ide> }); <ide> <del> it('should warn when stateless component returns undefined', () => { <del> spyOn(console, 'error'); <add> it('should throw when stateless component returns undefined', () => { <ide> function NotAComponent() { <ide> } <ide> expect(function() { <ide> ReactTestUtils.renderIntoDocument(<div><NotAComponent /></div>); <del> }).toThrow(); <del> expectDev(console.error.calls.count()).toBe(1); <del> expectDev(console.error.calls.argsFor(0)[0]).toContain( <add> }).toThrowError( <ide> 'NotAComponent(...): A valid React element (or null) must be returned. ' + <ide> 'You may have returned undefined, an array or some other invalid object.' <ide> ); <ide><path>src/renderers/shared/stack/reconciler/ReactCompositeComponent.js <ide> function StatelessComponent(Component) { <ide> StatelessComponent.prototype.render = function() { <ide> var Component = ReactInstanceMap.get(this)._currentElement.type; <ide> var element = Component(this.props, this.context, this.updater); <del> warnIfInvalidElement(Component, element); <ide> return element; <ide> }; <ide> <del>function warnIfInvalidElement(Component, element) { <del> if (__DEV__) { <del> warning( <del> element === null || element === false || React.isValidElement(element), <del> '%s(...): A valid React element (or null) must be returned. You may have ' + <del> 'returned undefined, an array or some other invalid object.', <del> Component.displayName || Component.name || 'Component' <del> ); <del> warning( <del> !Component.childContextTypes, <del> '%s(...): childContextTypes cannot be defined on a functional component.', <del> Component.displayName || Component.name || 'Component' <del> ); <del> } <del>} <del> <ide> function shouldConstruct(Component) { <ide> return !!(Component.prototype && Component.prototype.isReactComponent); <ide> } <ide> var ReactCompositeComponent = { <ide> // Support functional components <ide> if (!doConstruct && (inst == null || inst.render == null)) { <ide> renderedElement = inst; <del> warnIfInvalidElement(Component, renderedElement); <add> if (__DEV__) { <add> warning( <add> !Component.childContextTypes, <add> '%s(...): childContextTypes cannot be defined on a functional component.', <add> Component.displayName || Component.name || 'Component' <add> ); <add> } <ide> invariant( <ide> inst === null || <ide> inst === false ||
2
Ruby
Ruby
suppress warnings from git wrapper script
cf5ecfc06d0e280eff20667437770d3a21fb6dd5
<ide><path>Library/Homebrew/cmd/doctor.rb <ide> def find_relative_paths *relative_paths <ide> def inject_file_list(list, str) <ide> list.inject(str) { |s, f| s << " #{f}\n" } <ide> end <add> <add> # Git will always be on PATH because of the wrapper script in <add> # Library/Contributions/cmd, so we check if there is a *real* <add> # git here to avoid multiple warnings. <add> def git? <add> return @git if instance_variable_defined?(:@git) <add> @git = which("git") && quiet_system("git", "--version") <add> end <ide> ############# END HELPERS <ide> <ide> # Sorry for the lack of an indent here, the diff would have been unreadable. <ide> def __check_git_version <ide> end <ide> <ide> def check_for_git <del> if which "git" <add> if git? <ide> __check_git_version <ide> else <<-EOS.undent <ide> Git could not be found in your PATH. <ide> def check_for_git <ide> end <ide> <ide> def check_git_newline_settings <del> return unless which "git" <add> return unless git? <ide> <ide> autocrlf = `git config --get core.autocrlf`.chomp <ide> <ide> def check_git_newline_settings <ide> end <ide> <ide> def check_git_origin <del> return unless which('git') && (HOMEBREW_REPOSITORY/'.git').exist? <add> return unless git? && (HOMEBREW_REPOSITORY/'.git').exist? <ide> <ide> HOMEBREW_REPOSITORY.cd do <ide> origin = `git config --get remote.origin.url`.strip <ide> def check_missing_deps <ide> end <ide> <ide> def check_git_status <del> return unless which "git" <add> return unless git? <ide> HOMEBREW_REPOSITORY.cd do <ide> unless `git status --untracked-files=all --porcelain -- Library/Homebrew/ 2>/dev/null`.chomp.empty? <ide> <<-EOS.undent_________________________________________________________72 <ide> def check_for_pydistutils_cfg_in_home <ide> end <ide> <ide> def check_for_outdated_homebrew <del> return unless which 'git' <add> return unless git? <ide> HOMEBREW_REPOSITORY.cd do <ide> if File.directory? ".git" <ide> local = `git rev-parse -q --verify refs/remotes/origin/master`.chomp
1
PHP
PHP
fix method name
40277d71cc062697ab4697b2b296cf87186a84d1
<ide><path>src/Illuminate/Database/Eloquent/Builder.php <ide> public function whereHas($relation, Closure $callback, $operator = '>=', $count <ide> */ <ide> public function whereDoesntHave($relation, Closure $callback) <ide> { <del> return $this->hasNot($relation, 'and', $callback); <add> return $this->doesntHave($relation, 'and', $callback); <ide> } <ide> <ide> /**
1
Text
Text
remove unnecessary comments
fe95d5bca2d2b5f6e97ddd5ba2ac383bbb373ce5
<ide><path>curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/accessing-nested-objects.md <ide> assert(/=\s*myStorage\.car\.inside\[\s*("|')glove box\1\s*\]/g.test(code)); <ide> ## --seed-contents-- <ide> <ide> ```js <del>// Setup <ide> var myStorage = { <ide> "car": { <ide> "inside": { <ide> var myStorage = { <ide> } <ide> }; <ide> <del>var gloveBoxContents = undefined; // Change this line <add>var gloveBoxContents = undefined; <ide> ``` <ide> <ide> # --solutions--
1
Javascript
Javascript
save 43 bytes
5e64281a11301bb95f657e828c5010a9b24d9bff
<ide><path>src/manipulation.js <ide> jQuery.fn.extend({ <ide> // keepData is for internal use only--do not document <ide> remove: function( selector, keepData ) { <ide> var elem, <del> l = this.length, <del> i = 0; <add> i = 0, <add> l = this.length; <ide> <ide> for ( ; i < l; i++ ) { <ide> elem = this[ i ]; <ide> jQuery.fn.extend({ <ide> <ide> empty: function() { <ide> var elem, <del> l = this.length, <del> i = 0; <add> i = 0, <add> l = this.length; <ide> <ide> for ( ; i < l; i++ ) { <ide> elem = this[ i ]; <ide> jQuery.each({ <ide> }, function( name, original ) { <ide> jQuery.fn[ name ] = function( selector ) { <ide> var elems, <del> i = 0, <ide> ret = [], <ide> insert = jQuery( selector ), <del> last = insert.length - 1; <add> last = insert.length - 1, <add> i = 0; <ide> <ide> for ( ; i <= last; i++ ) { <ide> elems = i === last ? this : this.clone( true ); <ide> jQuery.each({ <ide> <ide> jQuery.extend({ <ide> clone: function( elem, dataAndEvents, deepDataAndEvents ) { <del> var destElements, srcElements, i, l, <del> inPage = jQuery.contains( elem.ownerDocument, elem ), <del> clone = elem.cloneNode( true ); <add> var i, l, srcElements, destElements, <add> clone = elem.cloneNode( true ), <add> inPage = jQuery.contains( elem.ownerDocument, elem ); <ide> <ide> // Support: IE >=9 <ide> // Fix Cloning issues <ide> jQuery.extend({ <ide> }, <ide> <ide> clean: function( elems, context, fragment, scripts, selection ) { <del> var elem, i, j, ll, tmp, tag, wrap, <add> var elem, tmp, tag, wrap, j, ll, <add> i = 0, <ide> l = elems.length, <ide> ret = [], <ide> container = context === document && fragment; <ide> jQuery.extend({ <ide> context = document; <ide> } <ide> <del> for ( i = 0; i < l; i++ ) { <add> for ( ; i < l; i++ ) { <ide> elem = elems[ i ]; <ide> <ide> if ( elem || elem === 0 ) { <ide> jQuery.extend({ <ide> }, <ide> <ide> cleanData: function( elems, /* internal */ acceptData ) { <del> var data, id, elem, type, <del> i = 0, <add> var id, data, elem, type, <ide> l = elems.length, <add> i = 0, <ide> internalKey = jQuery.expando, <ide> cache = jQuery.cache, <ide> special = jQuery.event.special; <ide> function restoreScript( elem ) { <ide> <ide> // Mark scripts as having already been evaluated <ide> function setGlobalEval( elems, refElements ) { <del> var i = 0, <del> l = elems.length; <add> var l = elems.length, <add> i = 0; <ide> <ide> for ( ; i < l; i++ ) { <ide> jQuery._data( elems[ i ], "globalEval", !refElements || jQuery._data( refElements[ i ], "globalEval" ) ); <ide> function cloneCopyEvent( src, dest ) { <ide> return; <ide> } <ide> <del> var type, l, i, <add> var i, l, type, <ide> oldData = jQuery._data( src ), <ide> curData = jQuery._data( dest, oldData ), <ide> events = oldData.events;
1
Javascript
Javascript
add test for util.inspect
3b50bded08c2cbcc652b79346121b4e39de231fc
<ide><path>test/parallel/test-util-inspect.js <ide> util.inspect({ hasOwnProperty: null }); <ide> util.inspect(subject, { customInspectOptions: true, seen: null }); <ide> } <ide> <add>{ <add> const subject = { [util.inspect.custom]: common.mustCall((depth) => { <add> assert.strictEqual(depth, null); <add> }) }; <add> util.inspect(subject, { depth: null }); <add>} <add> <ide> { <ide> // Returning `this` from a custom inspection function works. <ide> const subject = { a: 123, [util.inspect.custom]() { return this; } };
1
Javascript
Javascript
add "mustcall" to test-fs-readfile-unlink
413256d5e8fe01955b8666fea7f1fb29d072fa55
<ide><path>test/parallel/test-fs-readfile-unlink.js <ide> // USE OR OTHER DEALINGS IN THE SOFTWARE. <ide> <ide> 'use strict'; <del>require('../common'); <add>const common = require('../common'); <ide> <ide> // Test that unlink succeeds immediately after readFile completes. <ide> <ide> tmpdir.refresh(); <ide> <ide> fs.writeFileSync(fileName, buf); <ide> <del>fs.readFile(fileName, function(err, data) { <add>fs.readFile(fileName, common.mustCall((err, data) => { <ide> assert.ifError(err); <ide> assert.strictEqual(data.length, buf.length); <ide> assert.strictEqual(buf[0], 42); <ide> <ide> // Unlink should not throw. This is part of the test. It used to throw on <ide> // Windows due to a bug. <ide> fs.unlinkSync(fileName); <del>}); <add>}));
1
Javascript
Javascript
pass meta instead of looking up twice
85ef51674431f3a04dfe806522a9c711276cf645
<ide><path>packages/ember-metal/lib/watching.js <ide> function isKeyName(path) { <ide> // <ide> <ide> var DEP_SKIP = { __emberproto__: true }; // skip some keys and toString <del>function iterDeps(method, obj, depKey, seen) { <add>function iterDeps(method, obj, depKey, seen, meta) { <ide> <ide> var guid = guidFor(obj); <ide> if (!seen[guid]) seen[guid] = {}; <ide> if (seen[guid][depKey]) return ; <ide> seen[guid][depKey] = true; <ide> <del> var deps = meta(obj, false).deps; <add> var deps = meta.deps; <ide> deps = deps && deps[depKey]; <ide> if (deps) { <ide> for(var key in deps) { <ide> function iterDeps(method, obj, depKey, seen) { <ide> var WILL_SEEN, DID_SEEN; <ide> <ide> // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...) <del>function dependentKeysWillChange(obj, depKey) { <add>function dependentKeysWillChange(obj, depKey, meta) { <ide> var seen = WILL_SEEN, top = !seen; <ide> if (top) seen = WILL_SEEN = {}; <del> iterDeps(propertyWillChange, obj, depKey, seen); <add> iterDeps(propertyWillChange, obj, depKey, seen, meta); <ide> if (top) WILL_SEEN = null; <ide> } <ide> <ide> // called whenever a property has just changed to update dependent keys <del>function dependentKeysDidChange(obj, depKey) { <add>function dependentKeysDidChange(obj, depKey, meta) { <ide> var seen = DID_SEEN, top = !seen; <ide> if (top) seen = DID_SEEN = {}; <del> iterDeps(propertyDidChange, obj, depKey, seen); <add> iterDeps(propertyDidChange, obj, depKey, seen, meta); <ide> if (top) DID_SEEN = null; <ide> } <ide> <ide> var propertyWillChange = Ember.propertyWillChange = function(obj, keyName) { <ide> var m = meta(obj, false), proto = m.proto, desc = m.descs[keyName]; <ide> if (proto === obj) return ; <ide> if (desc && desc.willChange) desc.willChange(obj, keyName); <del> dependentKeysWillChange(obj, keyName); <add> dependentKeysWillChange(obj, keyName, m); <ide> chainsWillChange(obj, keyName); <ide> Ember.notifyBeforeObservers(obj, keyName); <ide> }; <ide> var propertyDidChange = Ember.propertyDidChange = function(obj, keyName) { <ide> var m = meta(obj, false), proto = m.proto, desc = m.descs[keyName]; <ide> if (proto === obj) return ; <ide> if (desc && desc.didChange) desc.didChange(obj, keyName); <del> dependentKeysDidChange(obj, keyName); <add> dependentKeysDidChange(obj, keyName, m); <ide> chainsDidChange(obj, keyName); <ide> Ember.notifyObservers(obj, keyName); <ide> };
1
Text
Text
fix typo if -> it
a06d6ec927b2aac9120d9a616b4933c3f5daa019
<ide><path>threejs/lessons/threejs-cameras.md <ide> and a frustum are all names of different kinds of solids. <ide> <div><div data-diagram="shapeFrustum"></div><div>frustum</div></div> <ide> </div> <ide> <del>I only point that out because I didn't know if for years. Some book or page would mention <add>I only point that out because I didn't know it for years. Some book or page would mention <ide> *frustum* and my eyes would glaze over. Understanding it's the name of a type of solid <ide> shape made those descriptions suddenly make more sense &#128517; <ide>
1
Javascript
Javascript
fix parse errors on older android webviews
f0f6da304c11d0bafcdb962f8ba69cfb719bc243
<ide><path>src/ngResource/resource.js <ide> angular.module('ngResource', ['ng']). <ide> return $q.reject(response); <ide> }); <ide> <del> promise.finally(function() { <add> promise['finally'](function() { <ide> value.$resolved = true; <ide> if (!isInstanceCall && cancellable) { <ide> value.$cancelRequest = angular.noop;
1
Ruby
Ruby
remove useless methods
44919e1cf08bbc181a5f416be9ba8b0933c0e6a6
<ide><path>activerecord/lib/active_record/counter_cache.rb <ide> def decrement_counter(counter_name, id) <ide> end <ide> end <ide> <del> protected <del> <del> def actually_destroyed? <del> @_actually_destroyed <del> end <del> <del> def clear_destroy_state <del> @_actually_destroyed = nil <del> end <del> <ide> private <ide> <ide> def _create_record(*)
1
Go
Go
enforce model for the json image format
3e8d1dfb69e74414b3466fee3195432f17445bbc
<ide><path>graph/image.go <ide> import ( <ide> ) <ide> <ide> type Image struct { <del> Id string <del> Parent string <del> Comment string <del> Created time.Time <add> Id string `json:"id"` <add> Parent string `json:"parent,omitempty"` <add> Comment string `json:"comment,omitempty"` <add> Created time.Time `json:"created"` <ide> graph *Graph <ide> } <ide>
1
Text
Text
add gengjiawen to collaborators
b0f75818f39ed4e6bd80eb7c4010c1daf5823ef7
<ide><path>README.md <ide> For information about the governance of the Node.js project, see <ide> **George Adams** &lt;george.adams@uk.ibm.com&gt; (he/him) <ide> * [geek](https://github.com/geek) - <ide> **Wyatt Preul** &lt;wpreul@gmail.com&gt; <add>* [gengjiawen](https://github.com/gengjiawen) - <add>**Jiawen Geng** &lt;technicalcute@gmail.com&gt; <ide> * [gibfahn](https://github.com/gibfahn) - <ide> **Gibson Fahnestock** &lt;gibfahn@gmail.com&gt; (he/him) <ide> * [gireeshpunathil](https://github.com/gireeshpunathil) -
1
Python
Python
remove unused import
6e4374e08e9cb2deb0266d3c4af61c3a6ee57deb
<ide><path>numpy/core/memmap.py <ide> <ide> import mmap <ide> from numeric import uint8, ndarray, dtype <del>from numerictypes import nbytes <ide> <ide> dtypedescr = dtype <ide> valid_filemodes = ["r", "c", "r+", "w+"]
1
Javascript
Javascript
fix a small bug in getblackcode
4b8274348ba86c85cc3ca1879619e3bce6a4a183
<ide><path>pdf.js <ide> var CCITTFaxStream = (function() { <ide> }; <ide> <ide> constructor.prototype.getBlackCode = function() { <del> var code, p, n; <add> var code, p; <ide> if (this.eoblock) { <ide> code = this.lookBits(13); <ide> if (code == EOF) <ide> var CCITTFaxStream = (function() { <ide> return p[1]; <ide> } <ide> } else { <del> for (var n = 2; n <= 6; ++n) { <add> var n; <add> for (n = 2; n <= 6; ++n) { <ide> code = this.lookBits(n); <ide> if (code == EOF) <ide> return 1; <ide> if (n < 6) <ide> code <<= 6 - n; <del> <ide> p = blackTable3[code]; <ide> if (p[0] == n) { <ide> this.eatBits(n); <ide> return p[1]; <ide> } <ide> } <del> for (var n = 7; n <= 12; ++n) { <add> for (n = 7; n <= 12; ++n) { <ide> code = this.lookBits(n); <ide> if (code == EOF) <ide> return 1; <ide> var CCITTFaxStream = (function() { <ide> if (code == EOF) <ide> return 1; <ide> if (n < 13) <del> code << 13 - n; <add> code <<= 13 - n; <ide> p = blackTable1[code]; <ide> if (p[0] == n) { <ide> this.eatBits(n);
1
PHP
PHP
fix bindings on unions by added a new binding type
89c5f0b6b9de31895709153af2ed98ab3f38c923
<ide><path>src/Illuminate/Database/Query/Builder.php <ide> class Builder <ide> 'where' => [], <ide> 'having' => [], <ide> 'order' => [], <add> 'union' => [], <ide> ]; <ide> <ide> /** <ide> public function union($query, $all = false) <ide> <ide> $this->unions[] = compact('query', 'all'); <ide> <del> return $this->mergeBindings($query); <add> return $this->addBinding($query->bindings, 'union'); <ide> } <ide> <ide> /** <ide><path>tests/Database/DatabaseQueryBuilderTest.php <ide> public function testUnions() <ide> $builder->union($this->getMySqlBuilder()->select('*')->from('users')->where('id', '=', 2)); <ide> $this->assertEquals('(select * from `users` where `id` = ?) union (select * from `users` where `id` = ?)', $builder->toSql()); <ide> $this->assertEquals([0 => 1, 1 => 2], $builder->getBindings()); <add> <add> $builder = $this->getMysqlBuilder(); <add> $second = $this->getMysqlBuilder()->select('*')->from('users')->orderByRaw('id = ?', 2); <add> $third = $this->getMysqlBuilder()->select('*')->from('users')->where('id', 3)->groupBy('id')->having('id', '!=', 4); <add> $builder->groupBy('a')->having('a', '=', 1)->union($second)->union($third); <add> $this->assertEquals([0 => 1, 1 => 2, 2 => 3, 3 => 4], $builder->getBindings()); <ide> } <ide> <ide> public function testUnionAlls()
2
Text
Text
add shuffle parameter to corpus api docs
72fece712f2706c3338365fa6eed179b6b7f8848
<ide><path>website/docs/api/corpus.md <ide> train/test skew. <ide> | `max_length` | Maximum document length. Longer documents will be split into sentences, if sentence boundaries are available. Defaults to `0` for no limit. ~~int~~ | <ide> | `limit` | Limit corpus to a subset of examples, e.g. for debugging. Defaults to `0` for no limit. ~~int~~ | <ide> | `augmenter` | Optional data augmentation callback. ~~Callable[[Language, Example], Iterable[Example]]~~ | <add>| `shuffle` | Whether to shuffle the examples. Defaults to `False`. ~~bool~~ | <ide> <ide> ## Corpus.\_\_call\_\_ {#call tag="method"} <ide>
1
Ruby
Ruby
introduce a timer class for reaping connections
cde7692d4e3e0e67e480cc6172f6e2bacaceeb5e
<ide><path>activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb <ide> module ConnectionAdapters <ide> # * +wait_timeout+: number of seconds to block and wait for a connection <ide> # before giving up and raising a timeout error (default 5 seconds). <ide> class ConnectionPool <add> class Reaper <add> attr_reader :pool, :frequency <add> <add> def initialize(pool, frequency) <add> @pool = pool <add> @frequency = frequency <add> end <add> <add> def start <add> return unless frequency <add> Thread.new(frequency, pool) { |t, p| <add> while true <add> sleep t <add> p.reap <add> end <add> } <add> end <add> end <add> <ide> include MonitorMixin <ide> <ide> attr_accessor :automatic_reconnect, :timeout <ide><path>activerecord/test/cases/reaper_test.rb <add>require "cases/helper" <add> <add>module ActiveRecord <add> module ConnectionAdapters <add> class ReaperTest < ActiveRecord::TestCase <add> attr_reader :pool <add> <add> def setup <add> super <add> @pool = ConnectionPool.new ActiveRecord::Base.connection_pool.spec <add> end <add> <add> def teardown <add> super <add> @pool.connections.each(&:close) <add> end <add> <add> # A reaper with nil time should never reap connections <add> def test_nil_time <add> conn = pool.checkout <add> pool.timeout = 0 <add> <add> count = pool.connections.length <add> conn.extend(Module.new { def active?; false; end; }) <add> <add> reaper = ConnectionPool::Reaper.new(pool, nil) <add> reaper.start <add> sleep 0.0001 <add> assert_equal count, pool.connections.length <add> end <add> <add> def test_some_time <add> conn = pool.checkout <add> pool.timeout = 0 <add> <add> count = pool.connections.length <add> conn.extend(Module.new { def active?; false; end; }) <add> <add> reaper = ConnectionPool::Reaper.new(pool, 0.0001) <add> reaper.start <add> sleep 0.0002 <add> assert_equal(count - 1, pool.connections.length) <add> end <add> end <add> end <add>end
2
Ruby
Ruby
rewrite metal tests
39215860912e4a29def2973b684d0830fc8b9904
<ide><path>railties/test/application/metal_test.rb <add>require 'isolation/abstract_unit' <add> <add>module ApplicationTests <add> class MetalTest < Test::Unit::TestCase <add> include ActiveSupport::Testing::Isolation <add> <add> def setup <add> build_app <add> boot_rails <add> <add> require 'rack/test' <add> extend Rack::Test::Methods <add> end <add> <add> def app <add> @app ||= begin <add> require "#{app_path}/config/environment" <add> Rails.application <add> end <add> end <add> <add> test "single metal endpoint" do <add> app_file 'app/metal/foo_metal.rb', <<-RUBY <add> class FooMetal <add> def self.call(env) <add> [200, { "Content-Type" => "text/html"}, ["FooMetal"]] <add> end <add> end <add> RUBY <add> <add> get "/" <add> assert_equal 200, last_response.status <add> assert_equal "FooMetal", last_response.body <add> end <add> <add> test "multiple metal endpoints" do <add> app_file 'app/metal/metal_a.rb', <<-RUBY <add> class MetalA <add> def self.call(env) <add> [404, { "Content-Type" => "text/html"}, ["Metal A"]] <add> end <add> end <add> RUBY <add> <add> app_file 'app/metal/metal_b.rb', <<-RUBY <add> class MetalB <add> def self.call(env) <add> [200, { "Content-Type" => "text/html"}, ["Metal B"]] <add> end <add> end <add> RUBY <add> <add> get "/" <add> assert_equal 200, last_response.status <add> assert_equal "Metal B", last_response.body <add> end <add> <add> test "pass through to application" do <add> app_file 'app/metal/foo_metal.rb', <<-RUBY <add> class FooMetal <add> def self.call(env) <add> [404, { "Content-Type" => "text/html"}, ["Not Found"]] <add> end <add> end <add> RUBY <add> <add> controller :foo, <<-RUBY <add> class FooController < ActionController::Base <add> def index <add> render :text => "foo" <add> end <add> end <add> RUBY <add> <add> app_file 'config/routes.rb', <<-RUBY <add> AppTemplate::Application.routes.draw do |map| <add> match ':controller(/:action)' <add> end <add> RUBY <add> <add> get "/foo" <add> assert_equal 200, last_response.status <add> assert_equal "foo", last_response.body <add> end <add> end <add>end <ide><path>railties/test/fixtures/metal/multiplemetals/app/metal/metal_a.rb <del>class MetalA <del> def self.call(env) <del> [404, { "Content-Type" => "text/html"}, ["Metal A"]] <del> end <del>end <ide><path>railties/test/fixtures/metal/multiplemetals/app/metal/metal_b.rb <del>class MetalB <del> def self.call(env) <del> [200, { "Content-Type" => "text/html"}, ["Metal B"]] <del> end <del>end <ide><path>railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb <del>class LegacyRoutes < Rails::Rack::Metal <del> def self.call(env) <del> [301, { "Location" => "http://example.com"}, []] <del> end <del>end <ide><path>railties/test/fixtures/metal/singlemetal/app/metal/foo_metal.rb <del>class FooMetal < Rails::Rack::Metal <del> def self.call(env) <del> [200, { "Content-Type" => "text/html"}, ["Hi"]] <del> end <del>end <ide><path>railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_a.rb <del>module Folder <del> class MetalA < Rails::Rack::Metal <del> def self.call(env) <del> [200, { "Content-Type" => "text/html"}, ["Hi"]] <del> end <del> end <del>end <ide><path>railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_b.rb <del>module Folder <del> class MetalB < Rails::Rack::Metal <del> def self.call(env) <del> [200, { "Content-Type" => "text/html"}, ["Hi"]] <del> end <del> end <del>end <ide><path>railties/test/metal_test.rb <del>require 'abstract_unit' <del> <del>class MetalTest < Test::Unit::TestCase <del> def test_metals_should_return_list_of_found_metal_apps <del> use_appdir("singlemetal") do <del> assert_equal(["FooMetal"], found_metals_as_string_array) <del> end <del> end <del> <del> def test_metals_should_respect_class_name_conventions <del> use_appdir("pluralmetal") do <del> assert_equal(["LegacyRoutes"], found_metals_as_string_array) <del> end <del> end <del> <del> def test_metals_should_return_alphabetical_list_of_found_metal_apps <del> use_appdir("multiplemetals") do <del> assert_equal(["MetalA", "MetalB"], found_metals_as_string_array) <del> end <del> end <del> <del> def test_metals_load_order_should_be_overriden_by_requested_metals <del> use_appdir("multiplemetals") do <del> Rails::Rack::Metal.requested_metals = ["MetalB", "MetalA"] <del> assert_equal(["MetalB", "MetalA"], found_metals_as_string_array) <del> end <del> end <del> <del> def test_metals_not_listed_should_not_load <del> use_appdir("multiplemetals") do <del> Rails::Rack::Metal.requested_metals = ["MetalB"] <del> assert_equal(["MetalB"], found_metals_as_string_array) <del> end <del> end <del> <del> def test_metal_finding_should_work_with_subfolders <del> use_appdir("subfolders") do <del> assert_equal(["Folder::MetalA", "Folder::MetalB"], found_metals_as_string_array) <del> end <del> end <del> <del> def test_metal_finding_with_requested_metals_should_work_with_subfolders <del> use_appdir("subfolders") do <del> Rails::Rack::Metal.requested_metals = ["Folder::MetalB"] <del> assert_equal(["Folder::MetalB"], found_metals_as_string_array) <del> end <del> end <del> <del> def test_metal_finding_should_work_with_multiple_metal_paths_in_185_and_below <del> use_appdir("singlemetal") do <del> engine_metal_path = "#{File.dirname(__FILE__)}/fixtures/plugins/engines/engine/app/metal" <del> Rails::Rack::Metal.metal_paths << engine_metal_path <del> $LOAD_PATH << engine_metal_path <del> assert_equal(["FooMetal", "EngineMetal"], found_metals_as_string_array) <del> end <del> end <del> <del> def test_metal_default_pass_through_on_404 <del> use_appdir("multiplemetals") do <del> result = Rails::Rack::Metal.new(app).call({}) <del> assert_equal 200, result.first <del> assert_equal ["Metal B"], result.last <del> end <del> end <del> <del> def test_metal_pass_through_on_417 <del> use_appdir("multiplemetals") do <del> Rails::Rack::Metal.pass_through_on = 417 <del> result = Rails::Rack::Metal.new(app).call({}) <del> assert_equal 404, result.first <del> assert_equal ["Metal A"], result.last <del> end <del> end <del> <del> def test_metal_pass_through_on_404_and_200 <del> use_appdir("multiplemetals") do <del> Rails::Rack::Metal.pass_through_on = [404, 200] <del> result = Rails::Rack::Metal.new(app).call({}) <del> assert_equal 402, result.first <del> assert_equal ["End of the Line"], result.last <del> end <del> end <del> <del> private <del> <del> def app <del> lambda{|env|[402,{},["End of the Line"]]} <del> end <del> <del> def use_appdir(root) <del> dir = "#{File.dirname(__FILE__)}/fixtures/metal/#{root}" <del> Rails::Rack::Metal.metal_paths = ["#{dir}/app/metal"] <del> Rails::Rack::Metal.requested_metals = nil <del> $LOAD_PATH << "#{dir}/app/metal" <del> yield <del> end <del> <del> def found_metals_as_string_array <del> Rails::Rack::Metal.metals.map { |m| m.to_s } <del> end <del>end
8
Ruby
Ruby
add opencv (even although old)
435e29385773030324c181b3b16d9cf438ef0634
<ide><path>Library/Homebrew/tap_migrations.rb <ide> TAP_MIGRATIONS = { <ide> 'octave' => 'homebrew/science', <add> 'opencv' => 'homebrew/science', <ide> 'grads' => 'homebrew/binary', <ide> 'denyhosts' => 'homebrew/boneyard', <ide> 'ipopt' => 'homebrew/science',
1
Python
Python
add tests for deployment
f8232df601eff4634a2256f47386f87aa99d0002
<ide><path>test/compute/test_deployment.py <add># -*- coding: utf-8 -*- <add># Licensed to the Apache Software Foundation (ASF) under one or more§ <add># contributor license agreements. See the NOTICE file distributed with <add># this work for additional information regarding copyright ownership. <add># The ASF licenses this file to You under the Apache License, Version 2.0 <add># (the "License"); you may not use this file except in compliance with <add># the License. You may obtain a copy of the License at <add># <add># http://www.apache.org/licenses/LICENSE-2.0 <add># <add># Unless required by applicable law or agreed to in writing, software <add># distributed under the License is distributed on an "AS IS" BASIS, <add># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add># See the License for the specific language governing permissions and <add># limitations under the License. <add> <add>import sys <add>import unittest <add> <add>from libcloud.compute.deployment import MultiStepDeployment, Deployment <add>from libcloud.compute.base import Node <add>from libcloud.compute.types import NodeState <add>from libcloud.compute.drivers.ec2 import EC2NodeDriver <add> <add>class MockDeployment(Deployment): <add> def run(self, node, client): <add> return node <add> <add>class DeploymentTests(unittest.TestCase): <add> <add> def test_multi_step_deployment(self): <add> msd = MultiStepDeployment() <add> self.assertEqual(len(msd.steps), 0) <add> <add> msd.add(MockDeployment()) <add> self.assertEqual(len(msd.steps), 1) <add> <add> node = Node(id=1, name='test', state=NodeState.RUNNING, <add> public_ip=['1.2.3.4'], private_ip='1.2.3.5', <add> driver=EC2NodeDriver) <add> self.assertEqual(node, msd.run(node=node, client=None)) <add> <add>if __name__ == '__main__': <add> sys.exit(unittest.main())
1
Text
Text
add changelog entry for
035e2976d0d85106fe6f613373fab18497498671
<ide><path>actionview/CHANGELOG.md <add>* Always escape the result of `link_to_unless` method. <add> <add> Before: <add> <add> link_to_unless(true, '<b>Showing</b>', 'github.com') <add> # => "<b>Showing</b>" <add> <add> After: <add> <add> link_to_unless(true, '<b>Showing</b>', 'github.com') <add> # => "&lt;b&gt;Showing&lt;/b&gt;" <add> <add> *dtaniwaki* <add> <ide> * Use a case insensitive URI Regexp for #asset_path. <ide> <ide> This fix a problem where the same asset path using different case are generating <ide> <ide> *Piotr Sarnacki*, *Łukasz Strzałkowski* <ide> <del>Please check [4-0-stable (ActionPack's CHANGELOG)](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes. <ide>\ No newline at end of file <add>Please check [4-0-stable (ActionPack's CHANGELOG)](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes.
1
Javascript
Javascript
check validity of segments
f871d25eb48dca224bb3796aa9cb5d714292662f
<ide><path>Libraries/Utilities/asyncRequire.js <ide> <ide> 'use strict'; <ide> <add>const dynamicRequire: number => mixed = (require: $FlowFixMe); <add> <ide> /** <ide> * The bundler must register the dependency properly when generating a call to <ide> * `asyncRequire`, that allows us to call `require` dynamically with confidence <ide> function asyncRequire(moduleID: number): Promise<mixed> { <ide> const {segmentId} = (require: $FlowFixMe).unpackModuleId(moduleID); <ide> return loadSegment(segmentId); <ide> }) <del> .then(() => require.call(null, (moduleID: $FlowFixMe))); <add> .then(() => dynamicRequire(moduleID)); <ide> } <ide> <ide> let segmentLoaders = new Map(); <ide> function loadSegment(segmentId: number): Promise<void> { <ide> if (segmentId === 0) { <ide> return; <ide> } <add> if (typeof global.__BUNDLE_DIGEST__ !== 'string') { <add> throw IncorrectBundleSetupError(); <add> } <add> const globalDigest = global.__BUNDLE_DIGEST__; <ide> let segmentLoader = segmentLoaders.get(segmentId); <ide> if (segmentLoader != null) { <ide> return segmentLoader; <ide> function loadSegment(segmentId: number): Promise<void> { <ide> } <ide> resolve(); <ide> }); <add> }).then(() => { <add> const metaModuleId = (require: $FlowFixMe).packModuleId({ <add> segmentId, <add> localId: 0, <add> }); <add> const metaModule = dynamicRequire(metaModuleId); <add> const digest: string = <add> typeof metaModule === 'object' && metaModule != null <add> ? (metaModule.BUNDLE_DIGEST: $FlowFixMe) <add> : 'undefined'; <add> if (digest !== globalDigest) { <add> throw new IncompatibleSegmentError(globalDigest, digest); <add> } <ide> }); <ide> segmentLoaders.set(segmentId, segmentLoader); <ide> return segmentLoader; <ide> class FetchSegmentNotAvailableError extends Error { <ide> } <ide> } <ide> <add>class IncorrectBundleSetupError extends Error { <add> constructor() { <add> super( <add> 'To be able to use split segments, the bundler must define a global ' + <add> 'constant `__BUNDLE_DIGEST__` that identifies the bundle uniquely.', <add> ); <add> } <add>} <add>asyncRequire.IncorrectBundleSetupError = IncorrectBundleSetupError; <add> <add>class IncompatibleSegmentError extends Error { <add> constructor(globalDigest, segmentDigest) { <add> super( <add> 'The split segment that is being loaded has been built from a ' + <add> 'different version of the code than the main segment. Or, the ' + <add> 'bundler is setting up the module #0 of the segment incorrectly. ' + <add> `The global digest is \`${globalDigest}\` while the segment is ` + <add> `\`${segmentDigest}\`.`, <add> ); <add> } <add>} <add>asyncRequire.IncompatibleSegmentError = IncompatibleSegmentError; <add> <ide> module.exports = asyncRequire;
1
Javascript
Javascript
use graphql filter for map
fcef62d5de1049b3303a85d74d31280022bd32ca
<ide><path>client/gatsby-node.js <ide> exports.createPages = function createPages({ graphql, actions, reporter }) { <ide> { <ide> allChallengeNode( <ide> sort: { fields: [superOrder, order, challengeOrder] } <add> filter: { isHidden: { eq: false } } <ide> ) { <ide> edges { <ide> node { <ide> block <ide> challengeType <del> isHidden <ide> fields { <ide> slug <ide> } <ide> exports.createPages = function createPages({ graphql, actions, reporter }) { <ide> } <ide> <ide> // Create challenge pages. <del> const challengeEdges = result.data.allChallengeNode.edges.filter( <del> ({ node: { isHidden } }) => !isHidden <add> result.data.allChallengeNode.edges.forEach( <add> createChallengePages(createPage) <ide> ); <ide> <del> challengeEdges.forEach(createChallengePages(createPage)); <del> <ide> // Create intro pages <ide> result.data.allMarkdownRemark.edges.forEach(edge => { <ide> const {
1
Javascript
Javascript
add benchmark for whatwg url properties
b7fadf0fa48dee89284e0510ad4de6343636495c
<ide><path>benchmark/url/whatwg-url-properties.js <add>'use strict'; <add> <add>var common = require('../common.js'); <add>var URL = require('url').URL; <add> <add>var bench = common.createBenchmark(main, { <add> url: [ <add> 'http://example.com/', <add> 'https://encrypted.google.com/search?q=url&q=site:npmjs.org&hl=en', <add> 'javascript:alert("node is awesome");', <add> 'http://user:pass@foo.bar.com:21/aaa/zzz?l=24#test' <add> ], <add> prop: ['toString', 'href', 'origin', 'protocol', <add> 'username', 'password', 'host', 'hostname', 'port', <add> 'pathname', 'search', 'searchParams', 'hash'], <add> n: [1e4] <add>}); <add> <add>function setAndGet(n, url, prop, alternative) { <add> const old = url[prop]; <add> bench.start(); <add> for (var i = 0; i < n; i += 1) { <add> url[prop] = n % 2 === 0 ? alternative : old; // set <add> url[prop]; // get <add> } <add> bench.end(n); <add>} <add> <add>function get(n, url, prop) { <add> bench.start(); <add> for (var i = 0; i < n; i += 1) { <add> url[prop]; // get <add> } <add> bench.end(n); <add>} <add> <add>function stringify(n, url, prop) { <add> bench.start(); <add> for (var i = 0; i < n; i += 1) { <add> url.toString(); <add> } <add> bench.end(n); <add>} <add> <add>const alternatives = { <add> href: 'http://user:pass@foo.bar.com:21/aaa/zzz?l=25#test', <add> protocol: 'https:', <add> username: 'user2', <add> password: 'pass2', <add> host: 'foo.bar.net:22', <add> hostname: 'foo.bar.org', <add> port: '23', <add> pathname: '/aaa/bbb', <add> search: '?k=99', <add> hash: '#abcd' <add>}; <add> <add>function getAlternative(prop) { <add> return alternatives[prop]; <add>} <add> <add>function main(conf) { <add> const n = conf.n | 0; <add> const url = new URL(conf.url); <add> const prop = conf.prop; <add> <add> switch (prop) { <add> case 'protocol': <add> case 'username': <add> case 'password': <add> case 'host': <add> case 'hostname': <add> case 'port': <add> case 'pathname': <add> case 'search': <add> case 'hash': <add> setAndGet(n, url, prop, getAlternative(prop)); <add> break; <add> // TODO: move href to the first group when the setter lands. <add> case 'href': <add> case 'origin': <add> case 'searchParams': <add> get(n, url, prop); <add> break; <add> case 'toString': <add> stringify(n, url); <add> break; <add> default: <add> throw new Error('Unknown prop'); <add> } <add>}
1
PHP
PHP
add truthy() and falsey() to validation
620aa6fa361e5154a7d125b0c35afa443f8091fa
<ide><path>src/Validation/Validation.php <ide> public static function localizedTime($check, $type = 'datetime', $format = null) <ide> } <ide> <ide> /** <del> * Boolean validation, determines if value passed is a boolean integer or true/false. <add> * Validates if passed value is boolean-like. <ide> * <del> * @param string $check a valid boolean <del> * @return bool Success <add> * The list of what is considered to be boolean values, may be set via $booleanValues. <add> * <add> * @param bool|int|string $check Value to check. <add> * @param string $booleanValues List of valid boolean values, defaults to `[true, false, 0, 1, '0', '1']`. <add> * @return bool Success. <add> */ <add> public static function boolean($check, array $booleanValues = []) <add> { <add> if (!$booleanValues) { <add> $booleanValues = [true, false, 0, 1, '0', '1']; <add> } <add> <add> return in_array($check, $booleanValues, true); <add> } <add> <add> /** <add> * Validates if given value is truthy. <add> * <add> * The list of what is considered to be truthy values, may be set via $truthyValues. <add> * <add> * @param bool|int|string $check Value to check. <add> * @param array $truthyValues List of valid truthy values, defaults to `[true, 1, '1']`. <add> * @return bool Success. <add> */ <add> public static function truthy($check, array $truthyValues = []) <add> { <add> if (!$truthyValues) { <add> $truthyValues = [true, 1, '1']; <add> } <add> <add> return in_array($check, $truthyValues, true); <add> } <add> <add> /** <add> * Validates if given value is falsey. <add> * <add> * The list of what is considered to be falsey values, may be set via $falseyValues. <add> * <add> * @param bool|int|string $check Value to check. <add> * @param array $falseyValues List of valid falsey values, defaults to `[false, 0, '0']`. <add> * @return bool Success. <ide> */ <del> public static function boolean($check) <add> public static function falsey($check, array $falseyValues = []) <ide> { <del> $booleanList = [0, 1, '0', '1', true, false]; <add> if (!$falseyValues) { <add> $falseyValues = [false, 0, '0']; <add> } <ide> <del> return in_array($check, $booleanList, true); <add> return in_array($check, $falseyValues, true); <ide> } <ide> <ide> /** <ide><path>tests/TestCase/Validation/ValidationTest.php <ide> public function testBoolean() <ide> $this->assertFalse(Validation::boolean('Boo!')); <ide> } <ide> <add> /** <add> * testBooleanWithOptions method <add> * <add> * @return void <add> */ <add> public function testBooleanWithOptions() <add> { <add> $this->assertTrue(Validation::boolean('0', ['0', '1'])); <add> $this->assertTrue(Validation::boolean('1', ['0', '1'])); <add> $this->assertFalse(Validation::boolean(0, ['0', '1'])); <add> $this->assertFalse(Validation::boolean(1, ['0', '1'])); <add> $this->assertFalse(Validation::boolean(false, ['0', '1'])); <add> $this->assertFalse(Validation::boolean(true, ['0', '1'])); <add> $this->assertFalse(Validation::boolean('false', ['0', '1'])); <add> $this->assertFalse(Validation::boolean('true', ['0', '1'])); <add> $this->assertTrue(Validation::boolean(0, [0, 1])); <add> $this->assertTrue(Validation::boolean(1, [0, 1])); <add> } <add> <add> /** <add> * testTruthy method <add> * <add> * @return void <add> */ <add> public function testTruthy() <add> { <add> $this->assertTrue(Validation::truthy(1)); <add> $this->assertTrue(Validation::truthy(true)); <add> $this->assertTrue(Validation::truthy('1')); <add> <add> $this->assertFalse(Validation::truthy('true')); <add> $this->assertFalse(Validation::truthy('on')); <add> $this->assertFalse(Validation::truthy('yes')); <add> <add> $this->assertFalse(Validation::truthy(0)); <add> $this->assertFalse(Validation::truthy(false)); <add> $this->assertFalse(Validation::truthy('0')); <add> $this->assertFalse(Validation::truthy('false')); <add> <add> $this->assertTrue(Validation::truthy('on', ['on', 'yes', 'true'])); <add> $this->assertTrue(Validation::truthy('yes', ['on', 'yes', 'true'])); <add> $this->assertTrue(Validation::truthy('true', ['on', 'yes', 'true'])); <add> <add> $this->assertFalse(Validation::truthy(1, ['on', 'yes', 'true'])); <add> $this->assertFalse(Validation::truthy(true, ['on', 'yes', 'true'])); <add> $this->assertFalse(Validation::truthy('1', ['on', 'yes', 'true'])); <add> <add> $this->assertTrue(Validation::truthy('true', ['on', 'yes', 'true'])); <add> } <add> <add> /** <add> * testTruthy method <add> * <add> * @return void <add> */ <add> public function testFalsey() <add> { <add> $this->assertTrue(Validation::falsey(0)); <add> $this->assertTrue(Validation::falsey(false)); <add> $this->assertTrue(Validation::falsey('0')); <add> <add> $this->assertFalse(Validation::falsey('false')); <add> $this->assertFalse(Validation::falsey('off')); <add> $this->assertFalse(Validation::falsey('no')); <add> <add> $this->assertFalse(Validation::falsey(1)); <add> $this->assertFalse(Validation::falsey(true)); <add> $this->assertFalse(Validation::falsey('1')); <add> $this->assertFalse(Validation::falsey('true')); <add> <add> $this->assertTrue(Validation::falsey('off', ['off', 'no', 'false'])); <add> $this->assertTrue(Validation::falsey('no', ['off', 'no', 'false'])); <add> $this->assertTrue(Validation::falsey('false', ['off', 'no', 'false'])); <add> <add> $this->assertFalse(Validation::falsey(0, ['off', 'no', 'false'])); <add> $this->assertFalse(Validation::falsey(false, ['off', 'no', 'false'])); <add> $this->assertFalse(Validation::falsey('0', ['off', 'yes', 'false'])); <add> <add> $this->assertTrue(Validation::falsey('false', ['off', 'no', 'false'])); <add> } <add> <ide> /** <ide> * testDateCustomRegx method <ide> *
2
Text
Text
update translation to b95ad29
87fb9caca7d223d1c4ef588f23622189052056b4
<ide><path>docs/docs/08-working-with-the-browser.ko-KR.md <ide> React는 DOM을 직접 다루지 않기 때문에 굉장히 빠릅니다. React <ide> 더 효율적이고 쉬우므로 대개의 경우 React의 "가짜 브라우저"를 이용해 작업을 하게 될 것입니다. 하지만 간혹 jQuery 플러그인 같은 서드파티 라이브러리를 다루다 보면 기저(underlying)의 API에 접근할 필요가 있을지도 모릅니다. React는 기저의 DOM API를 직접 다루는 회피방법을 제공합니다. <ide> <ide> <del>## Refs와 getDOMNode() <add>## Refs와 findDOMNode() <ide> <del>브라우저와 상호 작용하려면 DOM 노드에 대한 참조가 필요합니다. 모든 마운트된 컴포넌트는 `getDOMNode()` 함수를 갖고 있으며, 이를 통해서 참조를 얻을 수 있습니다. <add>브라우저와 상호 작용하려면 DOM 노드에 대한 참조가 필요합니다. React는 `React.findDOMNode(component)` 함수를 갖고 있으며, 이를 통해서 컴포넌트의 DOM 노드의 참조를 얻을 수 있습니다. <ide> <ide> > 주의: <ide> > <del>> `getDOMNode()`는 마운트 된 컴포넌트에서만 동작합니다 (DOM에 배치된 컴포넌트를 말합니다). 아직 마운트 되지 않은 컴포넌트에서 이를 호출하려고 하면 (컴포넌트가 아직 생성되기 이전인 `render()` 시점에 `getDOMNode()`를 호출한다든가) 예외가 발생합니다. <add>> `findDOMNode()`는 마운트 된 컴포넌트에서만 동작합니다 (DOM에 배치된 컴포넌트를 말합니다). 아직 마운트 되지 않은 컴포넌트에서 이를 호출하려고 하면 (컴포넌트가 아직 생성되기 이전인 `render()` 시점에 `findDOMNode()`를 호출한다든가) 예외가 발생합니다. <ide> <ide> React 컴포넌트에 대한 참조는 현재의 React 컴포넌트를 위해 `this`를, 소유한 컴포넌트의 참조를 얻기 위해 refs를 사용해 얻을 수 있습니다. 다음과 같이 동작합니다: <ide> <ide> ```javascript <ide> var MyComponent = React.createClass({ <ide> handleClick: function() { <ide> // raw DOM API를 사용해 명시적으로 텍스트 인풋을 포커스 합니다. <del> this.refs.myTextInput.getDOMNode().focus(); <add> React.findDOMNode(this.refs.myTextInput).focus(); <ide> }, <ide> render: function() { <ide> // ref 어트리뷰트는 컴포넌트가 마운트되면 그에 대한 참조를 this.refs에 추가합니다. <ide> React는 이 프로세스에 훅을 지정할 수 있는 생명주기 메소드 <ide> <ide> _마운트된_ 합성 컴포넌트들은 다음과 같은 메소드를 지원합니다: <ide> <del>* `getDOMNode(): DOMElement`는 렌더링 된 DOM 노드에 대한 참조를 얻기 위해 모든 마운트된 컴포넌트에서 호출할 수 있습니다. <add>* `findDOMNode(): DOMElement`는 렌더링 된 DOM 노드에 대한 참조를 얻기 위해 모든 마운트된 컴포넌트에서 호출할 수 있습니다. <ide> * `forceUpdate()`는 `this.setState`를 사용하지 않고 컴포넌트 state의 더 깊은 측면(deeper aspect)의 변경된 것을 알고 있을 때 모든 마운트된 컴포넌트에서 호출할 수 있습니다. <ide> <ide> <ide><path>docs/docs/08.1-more-about-refs.ko-KR.md <ide> React는 `render()`로 출력된 컴포넌트에 추가할 수 있는 아주 특 <ide> this.refs.myInput <ide> ``` <ide> <del> `this.refs.myInput.getDOMNode()`를 호출해 컴포넌트의 DOM 노드에 접근할 수 있습니다. <add> `React.findDOMNode(this.refs.myInput)`를 호출해 컴포넌트의 DOM 노드에 접근할 수 있습니다. <ide> <ide> ## 예제 완성하기 <ide> <ide> React는 `render()`로 출력된 컴포넌트에 추가할 수 있는 아주 특 <ide> // input을 비워준다 <ide> this.setState({userInput: ''}, function() { <ide> // 이 코드는 컴포넌트가 다시 렌더 된 다음 실행됩니다 <del> this.refs.theInput.getDOMNode().focus(); // 짠! 포커스 됨! <add> React.findDOMNode(this.refs.theInput).focus(); // 짠! 포커스 됨! <ide> }); <ide> }, <ide> render: function() { <ide> Refs는 반응적인 `props`와 `state` 스트리밍을 통해서는 불편했 <ide> ### 이점: <ide> <ide> - 컴포넌트 클래스에 public 메소드(ex. Typeahead의 reset)를 선언할 수 있으며 refs를 통해 그를 호출할 수 있습니다. (ex. `this.refs.myTypeahead.reset()`) <del>- DOM을 측정하기 위해서는 거의 항상 `<input />` 같은 "기본" 컴포넌트를 다루고 `this.refs.myInput.getDOMNode()`를 통해 그 기저의 DOM 노드에 접근해야 합니다. Refs는 이 일을 확실하게 수행하는 몇 안 되는 실용적인 방법의 하나입니다. <add>- DOM을 측정하기 위해서는 거의 항상 `<input />` 같은 "기본" 컴포넌트를 다루고 `React.findDOMNode(this.refs.myInput)`를 통해 그 기저의 DOM 노드에 접근해야 합니다. Refs는 이 일을 확실하게 수행하는 몇 안 되는 실용적인 방법의 하나입니다. <ide> - Refs는 자동으로 기록을 관리합니다! 자식이 파괴되면, 그의 ref도 마찬가지로 파괴됩니다. 참조를 유지하기 위해 뭔가 미친 짓을 하지 않는 한, 메모리 걱정은 하지 않아도 됩니다. <ide> <ide> ### 주의: <ide><path>docs/docs/10.4-test-utils.ko-KR.md <ide> DOM 노드에 이벤트 디스패치하는 것을 시뮬레이트합니다. 선 <ide> 사용 예: <ide> <ide> ```javascript <del>var node = this.refs.input.getDOMNode(); <add>var node = React.findDOMNode(this.refs.input); <ide> React.addons.TestUtils.Simulate.click(node); <ide> React.addons.TestUtils.Simulate.change(node, {target: {value: 'Hello, world'}}); <ide> React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"}); <ide><path>docs/docs/ref-01-top-level-api.ko-KR.md <ide> boolean isValidElement(* object) <ide> <ide> 주어진 객체가 ReactElement인지 확인합니다. <ide> <add>### React.findDOMNode <add> <add>```javascript <add>DOMElement findDOMNode(ReactComponent component) <add>``` <add>이 컴포넌트가 DOM에 마운트된 경우 해당하는 네이티브 브라우저 DOM 엘리먼트를 리턴합니다. 이 메소드는 폼 필드의 값이나 DOM의 크기/위치 등 DOM에서 정보를 읽을 때 유용합니다. `render`가 `null`이나 `false`를 리턴할 때 `React.findDOMNode()`는 `null`을 리턴합니다. <add> <ide> <ide> ### React.DOM <ide> <ide><path>docs/docs/ref-02-component-api.ko-KR.md <ide> DOMElement getDOMNode() <ide> <ide> 이 컴포넌트가 DOM에 마운트된 경우 해당하는 네이티브 브라우저 DOM 엘리먼트를 리턴합니다. 이 메소드는 폼 필드의 값이나 DOM의 크기/위치 등 DOM에서 정보를 읽을 때 유용합니다. `render`가 `null`이나 `false`를 리턴하였다면 `this.getDOMNode()`는 `null`을 리턴합니다. <ide> <add>> 주의: <add>> <add>> getDOMNode는 비 추천 상태가 되었고 [React.findDOMNode()](/react/docs/top-level-api.html#react.finddomnode)로 교체되었습니다. <add> <ide> <ide> ### isMounted <ide> <ide><path>docs/docs/ref-03-component-specs.ko-KR.md <ide> ReactComponent render() <ide> <ide> 호출되면 `this.props`와 `this.state`를 토대로 하나의 자식 컴포넌트를 리턴합니다. 이 자식 컴포넌트는 네이티브 DOM 컴포넌트의 가상 표현 (`<div />`나 `React.DOM.div()` 등) 또는 직접 정의한 조합(composite) 컴포넌트가 될 수 있습니다. <ide> <del>아무 것도 렌더링되지 않도록 하려면 `null`이나 `false`를 리턴합니다. React는 지금의 차이 비교 알고리즘이 작동할 수 있도록 내부적으로는 `<noscript>` 태그를 렌더링합니다. `null`이나 `false`를 리턴한 경우, `this.getDOMNode()`는 `null`을 리턴합니다. <add>아무 것도 렌더링되지 않도록 하려면 `null`이나 `false`를 리턴합니다. React는 지금의 차이 비교 알고리즘이 작동할 수 있도록 내부적으로는 `<noscript>` 태그를 렌더링합니다. `null`이나 `false`를 리턴한 경우, `React.findDOMNode(this)`는 `null`을 리턴합니다. <ide> <ide> `render()` 함수는 순수 함수여야 합니다. 즉, 컴포넌트의 상태를 변경하지 않고, 여러번 호출해도 같은 결과를 리턴하며, DOM을 읽고 쓰거나 브라우저와 상호작용(예를 들어 `setTimeout`를 사용)하지 않아야 합니다. 브라우저와 상호작용해야 한다면 `componentDidMount()`나 다른 생명주기 메소드에서 수행해야 합니다. `render()` 함수를 순수 함수로 유지하면 서버 렌더링이 훨씬 쓸만해지고 컴포넌트에 대해 생각하기 쉬워집니다. <ide> <ide> componentWillMount() <ide> componentDidMount() <ide> ``` <ide> <del>최초 렌더링이 일어난 다음 클라이언트에서만 한번 호출됩니다. (서버에서는 호출되지 않습니다.) 이 시점에 컴포넌트는 `this.getDOMNode()`로 접근 가능한 DOM 표현을 가집니다. <add>최초 렌더링이 일어난 다음 클라이언트에서만 한번 호출됩니다. (서버에서는 호출되지 않습니다.) 이 시점에 컴포넌트는 `React.findDOMNode(this)`로 접근 가능한 DOM 표현을 가집니다. <ide> <ide> 다른 JavaScript 프레임워크를 연동하거나, `setTimeout`/`setInterval`로 타이머를 설정하고 AJAX 요청을 보내는 등의 작업을 이 메소드에서 합니다. <ide> <del>> 주의: <del>> <del>> v0.9 이전까지 DOM 노드가 마지막 인자로 넘어왔습니다. 이것을 사용하고 있었다면 이제는 `this.getDOMNode()`로 DOM 노드에 접근할 수 있습니다. <del> <ide> <ide> ### 업데이트 시: componentWillReceiveProps <ide> <ide> componentDidUpdate(object prevProps, object prevState) <ide> <ide> 컴포넌트가 업데이트된 뒤 DOM을 조작해야 하는 경우 사용할 수 있습니다. <ide> <del>> 주의: <del>> <del>> v0.9 이전까지 DOM 노드가 마지막 인자로 넘어왔습니다. 이것을 사용하고 있었다면 이제는 `this.getDOMNode()`로 DOM 노드에 접근할 수 있습니다. <del> <ide> <ide> ### 마운트 해제 시: componentWillUnmount <ide> <ide><path>docs/docs/tutorial.ko-KR.md <ide> next: thinking-in-react-ko-KR.html <ide> <ide> 이 튜토리얼을 시작할 때 필요한 건 아니지만, 나중에 실행 중인 서버에 `POST` 요청을 하는 기능을 추가하게 될 것입니다. 서버를 구성하는 것이 익숙하다면, 본인이 편한 방식대로 서버를 구성해 주세요. 서버사이드에 대한 고민없이 React의 학습 그 자체에 집중하고 싶은 분들을 위해서, 몇 가지 언어로 간단한 서버코드를 작성해 놓았습니다 - JavaScript (Node.js), Python, Ruby, Go, PHP 버전이 있고, GitHub에서 찾아보실 수 있습니다. [소스를 확인](https://github.com/reactjs/react-tutorial/)하거나 [zip 파일을 다운로드](https://github.com/reactjs/react-tutorial/archive/master.zip)하고 시작하세요. <ide> <del>튜토리얼을 다운로드 받아 시작한다면, `public/index.html`을 열고 바로 시작하세요. <add>튜토리얼을 시작하려면, `public/index.html`을 열고 바로 시작하세요. <ide> <ide> ### 시작하기 <ide> <ide> var CommentForm = React.createClass({ <ide> var CommentForm = React.createClass({ <ide> handleSubmit: function(e) { <ide> e.preventDefault(); <del> var author = this.refs.author.getDOMNode().value.trim(); <del> var text = this.refs.text.getDOMNode().value.trim(); <add> var author = React.findDOMNode(this.refs.author).value.trim(); <add> var text = React.findDOMNode(this.refs.text).value.trim(); <ide> if (!text || !author) { <ide> return; <ide> } <ide> // TODO: 서버에 요청을 전송합니다 <del> this.refs.author.getDOMNode().value = ''; <del> this.refs.text.getDOMNode().value = ''; <add> React.findDOMNode(this.refs.author).value = ''; <add> React.findDOMNode(this.refs.text).value = ''; <add> return; <ide> }, <ide> render: function() { <ide> return ( <ide> React는 카멜케이스 네이밍 컨벤션으로 컴포넌트에 이벤트 핸 <ide> <ide> ##### Refs <ide> <del>우리는 자식 컴포넌트의 이름을 지정하기 위해 `ref` 어트리뷰트를, 컴포넌트를 참조하기 위해 `this.refs`를 사용합니다. 고유한(native) 브라우저 DOM 엘리먼트를 얻기 위해 `getDOMNode()`를 호출할 수 있습니다. <add>우리는 자식 컴포넌트의 이름을 지정하기 위해 `ref` 어트리뷰트를, 컴포넌트를 참조하기 위해 `this.refs`를 사용합니다. 고유한(native) 브라우저 DOM 엘리먼트를 얻기 위해 `React.findDOMNode(component)`를 호출할 수 있습니다. <ide> <ide> ##### props으로 콜백 처리하기 <ide> <ide> var CommentBox = React.createClass({ <ide> var CommentForm = React.createClass({ <ide> handleSubmit: function(e) { <ide> e.preventDefault(); <del> var author = this.refs.author.getDOMNode().value.trim(); <del> var text = this.refs.text.getDOMNode().value.trim(); <add> var author = React.findDOMNode(this.refs.author).value.trim(); <add> var text = React.findDOMNode(this.refs.text).value.trim(); <ide> if (!text || !author) { <ide> return; <ide> } <ide> this.props.onCommentSubmit({author: author, text: text}); <del> this.refs.author.getDOMNode().value = ''; <del> this.refs.text.getDOMNode().value = ''; <add> React.findDOMNode(this.refs.author).value = ''; <add> React.findDOMNode(this.refs.text).value = ''; <add> return; <ide> }, <ide> render: function() { <ide> return (
7
Javascript
Javascript
fix broken tests for element dsl
9260f4867a6d1aaa51585a3efac9d315b74eae53
<ide><path>test/scenario/DSLSpec.js <ide> describe("DSL", function() { <ide> expect(future.fulfilled).toBeTruthy(); <ide> } <ide> it('should find elements on the page and provide jquery api', function() { <del> var future = element('.reports-detail').find(); <add> var future = element('.reports-detail'); <ide> expect(future.name).toEqual("Find element '.reports-detail'"); <ide> timeTravel(future); <ide> expect(future.value.text()). <ide> describe("DSL", function() { <ide> toEqual('Description : Details...'); <ide> }); <ide> it('should find elements with angular syntax', function() { <del> var future = element('{{report.description}}').find(); <add> var future = element('{{report.description}}'); <ide> expect(future.name).toEqual("Find element '{{report.description}}'"); <ide> timeTravel(future); <ide> expect(future.value.text()).toEqual('Details...');
1
Javascript
Javascript
fix corruption in writefile and writefilesync
c9207f7fc24d6ab879561632ba3c08fee07a9cc4
<ide><path>lib/fs.js <ide> function writeAll(fd, buffer, offset, length, position, callback) { <ide> } else { <ide> offset += written; <ide> length -= written; <del> position += written; <add> if (position !== null) { <add> position += written; <add> } <ide> writeAll(fd, buffer, offset, length, position, callback); <ide> } <ide> } <ide> fs.writeFileSync = function(path, data, options) { <ide> if (!(data instanceof Buffer)) { <ide> data = new Buffer('' + data, options.encoding || 'utf8'); <ide> } <del> var written = 0; <add> var offset = 0; <ide> var length = data.length; <ide> var position = /a/.test(flag) ? null : 0; <ide> try { <del> while (written < length) { <del> written += fs.writeSync(fd, data, written, length - written, position); <del> position += written; <add> while (length > 0) { <add> var written = fs.writeSync(fd, data, offset, length, position); <add> offset += written; <add> length -= written; <add> if (position !== null) { <add> position += written; <add> } <ide> } <ide> } finally { <ide> fs.closeSync(fd);
1
Javascript
Javascript
change param to parameter
bbb81bb5bc2d0fdc27eec536c7ea04049355d90c
<ide><path>packages/ember-htmlbars/lib/helpers/each.js <ide> import decodeEachKey from 'ember-htmlbars/utils/decode-each-key'; <ide> of the base Handlebars `{{#each}}` helper. <ide> <ide> The default behavior of `{{#each}}` is to yield its inner block once for every <del> item in an array passing the item as the first param to the block. <add> item in an array passing the item as the first block parameter. <ide> <ide> ```javascript <ide> var developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}]; <ide> import decodeEachKey from 'ember-htmlbars/utils/decode-each-key'; <ide> {{/each}} <ide> ``` <ide> <del> During iteration, the index of each item in the array is provided as a second block param. <add> During iteration, the index of each item in the array is provided as a second block parameter. <ide> <ide> ```handlebars <ide> <ul>
1
Javascript
Javascript
refactor the code in test-http-keep-alive
1e98ea3f5e69a488edd9be76242ebb6b04033910
<ide><path>test/parallel/test-http-keep-alive.js <ide> 'use strict'; <del>require('../common'); <del>var assert = require('assert'); <del>var http = require('http'); <add>const common = require('../common'); <add>const assert = require('assert'); <add>const http = require('http'); <ide> <del>var body = 'hello world\n'; <add>const server = http.createServer(common.mustCall((req, res) => { <add> const body = 'hello world\n'; <ide> <del>var server = http.createServer(function(req, res) { <ide> res.writeHead(200, {'Content-Length': body.length}); <ide> res.write(body); <ide> res.end(); <del>}); <add>}, 3)); <ide> <del>var agent = new http.Agent({maxSockets: 1}); <del>var headers = {'connection': 'keep-alive'}; <del>var name; <add>const agent = new http.Agent({maxSockets: 1}); <add>const headers = {'connection': 'keep-alive'}; <add>let name; <ide> <del>server.listen(0, function() { <add>server.listen(0, common.mustCall(function() { <ide> name = agent.getName({ port: this.address().port }); <ide> http.get({ <ide> path: '/', headers: headers, port: this.address().port, agent: agent <del> }, function(response) { <del> assert.equal(agent.sockets[name].length, 1); <del> assert.equal(agent.requests[name].length, 2); <add> }, common.mustCall((response) => { <add> assert.strictEqual(agent.sockets[name].length, 1); <add> assert.strictEqual(agent.requests[name].length, 2); <ide> response.resume(); <del> }); <add> })); <ide> <ide> http.get({ <ide> path: '/', headers: headers, port: this.address().port, agent: agent <del> }, function(response) { <del> assert.equal(agent.sockets[name].length, 1); <del> assert.equal(agent.requests[name].length, 1); <add> }, common.mustCall((response) => { <add> assert.strictEqual(agent.sockets[name].length, 1); <add> assert.strictEqual(agent.requests[name].length, 1); <ide> response.resume(); <del> }); <add> })); <ide> <ide> http.get({ <ide> path: '/', headers: headers, port: this.address().port, agent: agent <del> }, function(response) { <del> response.on('end', function() { <del> assert.equal(agent.sockets[name].length, 1); <add> }, common.mustCall((response) => { <add> response.on('end', common.mustCall(() => { <add> assert.strictEqual(agent.sockets[name].length, 1); <ide> assert(!agent.requests.hasOwnProperty(name)); <ide> server.close(); <del> }); <add> })); <ide> response.resume(); <del> }); <del>}); <add> })); <add>})); <ide> <del>process.on('exit', function() { <add>process.on('exit', () => { <ide> assert(!agent.sockets.hasOwnProperty(name)); <ide> assert(!agent.requests.hasOwnProperty(name)); <ide> });
1
Javascript
Javascript
add more consistency
7d969a05de6a45543bc31a3b982828865bc57cdb
<ide><path>local-cli/__mocks__/fs.js <ide> fs.readdir.mockImplementation((filepath, callback) => { <ide> }); <ide> <ide> fs.readFile.mockImplementation(function(filepath, encoding, callback) { <add> filepath = path.normalize(filepath); <ide> callback = asyncCallback(callback); <ide> if (arguments.length === 2) { <ide> callback = encoding; <ide> fs.readFile.mockImplementation(function(filepath, encoding, callback) { <ide> }); <ide> <ide> fs.readFileSync.mockImplementation(function(filepath, encoding) { <add> filepath = path.normalize(filepath); <ide> const node = getToNode(filepath); <ide> if (isDirNode(node)) { <ide> throw new Error('Error readFileSync a dir: ' + filepath); <ide> fs.readFileSync.mockImplementation(function(filepath, encoding) { <ide> fs.writeFile.mockImplementation(asyncify(fs.writeFileSync)); <ide> <ide> fs.writeFileSync.mockImplementation((filePath, content, options) => { <add> filePath = path.normalize(filePath); <ide> if (options == null || typeof options === 'string') { <ide> options = {encoding: options}; <ide> } <ide><path>local-cli/__tests__/fs-mock-test.js <ide> describe('fs mock', () => { <ide> fs.writeFileSync('/dir/test', 'foobar', 'utf8'), <ide> ).toThrowError('ENOENT: no such file or directory'); <ide> }); <add> <add> it('properly normalizes paths', () => { <add> fs.writeFileSync('/test/foo/../bar/../../tadam', 'beep', 'utf8'); <add> const content = fs.readFileSync('/glo/../tadam', 'utf8'); <add> expect(content).toEqual('beep'); <add> }); <ide> }); <ide> <ide> describe('mkdirSync()', () => {
2
Python
Python
add missing tokenizer exceptions
48177c4f922b03938c0fa8a7e7becb50e706eee9
<ide><path>spacy/lang/da/__init__.py <ide> class Defaults(Language.Defaults): <ide> lex_attr_getters = dict(Language.Defaults.lex_attr_getters) <ide> lex_attr_getters[LANG] = lambda text: 'da' <ide> <del> tokenizer_exceptions = update_exc(BASE_EXCEPTIONS) <add> tokenizer_exceptions = update_exc(BASE_EXCEPTIONS, TOKENIZER_EXCEPTIONS) <ide> stop_words = set(STOP_WORDS) <ide> <ide>
1
Ruby
Ruby
add install method
e7497e33c0b02c0290721be7075b0c0473459d65
<ide><path>Library/Homebrew/formula.rb <ide> def test_fixtures(file) <ide> <ide> protected <ide> <add> def install <add> end <add> <ide> # Pretty titles the command and buffers stdout/stderr <ide> # Throws if there's an error <ide> def system cmd, *args
1
PHP
PHP
fix use of deprecated methods
a3bec4690a56ebcc83e6430f4e37d94f6093baa4
<ide><path>src/ORM/Query.php <ide> protected function _transformQuery() <ide> } <ide> <ide> if (empty($this->_parts['from'])) { <del> $this->from([$this->_repository->getAlias() => $this->_repository->table()]); <add> $this->from([$this->_repository->getAlias() => $this->_repository->getTable()]); <ide> } <ide> $this->_addDefaultFields(); <ide> $this->getEagerLoader()->attachAssociations($this, $this->_repository, !$this->_hasFields); <ide> protected function _dirty() <ide> */ <ide> public function update($table = null) <ide> { <del> $table = $table ?: $this->repository()->table(); <add> $table = $table ?: $this->repository()->getTable(); <ide> <ide> return parent::update($table); <ide> } <ide> public function update($table = null) <ide> public function delete($table = null) <ide> { <ide> $repo = $this->repository(); <del> $this->from([$repo->getAlias() => $repo->table()]); <add> $this->from([$repo->getAlias() => $repo->getTable()]); <ide> <ide> return parent::delete(); <ide> } <ide> public function delete($table = null) <ide> */ <ide> public function insert(array $columns, array $types = []) <ide> { <del> $table = $this->repository()->table(); <add> $table = $this->repository()->getTable(); <ide> $this->into($table); <ide> <ide> return parent::insert($columns, $types); <ide><path>src/ORM/ResultSet.php <ide> protected function _groupResult($row) <ide> $results[$defaultAlias]['_matchingData'] = $results['_matchingData']; <ide> } <ide> <del> $options['source'] = $this->_defaultTable->registryAlias(); <add> $options['source'] = $this->_defaultTable->getRegistryAlias(); <ide> if (isset($results[$defaultAlias])) { <ide> $results = $results[$defaultAlias]; <ide> }
2
Javascript
Javascript
fix typo in comment (satsify → satisfy)
9d17b562ba427adb1bced98f4231406ec573c422
<ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.new.js <ide> function commitRootImpl(root, renderPriorityLevel) { <ide> <ide> // Check if there are any effects in the whole tree. <ide> // TODO: This is left over from the effect list implementation, where we had <del> // to check for the existence of `firstEffect` to satsify Flow. I think the <add> // to check for the existence of `firstEffect` to satisfy Flow. I think the <ide> // only other reason this optimization exists is because it affects profiling. <ide> // Reconsider whether this is necessary. <ide> const subtreeHasEffects = <ide><path>packages/react-reconciler/src/ReactFiberWorkLoop.old.js <ide> function commitRootImpl(root, renderPriorityLevel) { <ide> <ide> // Check if there are any effects in the whole tree. <ide> // TODO: This is left over from the effect list implementation, where we had <del> // to check for the existence of `firstEffect` to satsify Flow. I think the <add> // to check for the existence of `firstEffect` to satisfy Flow. I think the <ide> // only other reason this optimization exists is because it affects profiling. <ide> // Reconsider whether this is necessary. <ide> const subtreeHasEffects =
2
Ruby
Ruby
add test to check for dependent casks
fcb1aa8aef1fa09714166a60b887226d7a189d1f
<ide><path>Library/Homebrew/test/keg_spec.rb <ide> def unreliable_dependencies(deps) <ide> dependencies [{ "full_name" => "foo", "version" => "1.1" }] # different version <ide> expect(described_class.find_some_installed_dependents([keg])).to eq([[keg], ["bar"]]) <ide> end <add> <add> def stub_cask_name(name, version, dependency) <add> c = Cask::CaskLoader.load(+<<-RUBY) <add> cask "#{name}" do <add> version "#{version}" <add> <add> url "c-1" <add> depends_on formula: "#{dependency}" <add> end <add> RUBY <add> <add> stub_cask_loader c <add> c <add> end <add> <add> def setup_test_cask(name, version, dependency) <add> c = stub_cask_name(name, version, dependency) <add> Cask::Caskroom.path.join(name, c.version).mkpath <add> c <add> end <add> <add> specify "identify dependent casks" do <add> setup_test_cask("qux", "1.0.0", "foo") <add> dependents = described_class.find_some_installed_dependents([keg]).last <add> expect(dependents.include?("qux")).to eq(true) <add> end <ide> end <ide> end
1
Text
Text
add comma in readme to increase clarity
fc6507dd4ee3c77983cd39f3ac8121ec8f5f9ac4
<ide><path>README.md <ide> the title of man pages). <ide> <ide> ## Download <ide> <del>Binaries, installers and source tarballs are available at <add>Binaries, installers, and source tarballs are available at <ide> <https://iojs.org>. <ide> <ide> **Releases** are available at <https://iojs.org/dist/>, listed under
1
PHP
PHP
add link to cookie rfc for reference
1c6610cc7a23250882cdb71b4d07220eb87f9ff7
<ide><path>src/Http/Cookie/Cookie.php <ide> public function getName() <ide> * @param string $name Name of the cookie <ide> * @return void <ide> * @throws \InvalidArgumentException <add> * @link https://tools.ietf.org/html/rfc2616#section-2.2 Rules for naming cookies. <ide> */ <ide> protected function validateName($name) <ide> {
1
PHP
PHP
add test assertions and refactor shared code
2e12b89f64b9e35cd1b3f2f4198aa4a095146642
<ide><path>src/Error/BaseErrorHandler.php <ide> protected function _logError($level, $data) <ide> 'start' => 1, <ide> 'format' => 'log' <ide> ]); <del> <add> <ide> $request = Router::getRequest(); <ide> if ($request) { <del> $message .= "\nRequest URL: " . $request->here(); <del> <del> $referer = $request->env('HTTP_REFERER'); <del> if ($referer) { <del> $message .= "\nReferer URL: " . $referer; <del> } <del> <del> $clientIp = $request->clientIp(); <del> if ($clientIp && $clientIp !== '::1') { <del> $message .= "\nClient IP: " . $clientIp; <del> } <add> $message .= $this->_requestContext($request); <ide> } <del> <ide> $message .= "\nTrace:\n" . $trace . "\n"; <ide> } <ide> $message .= "\n\n"; <ide> protected function _logException(Exception $exception) <ide> return Log::error($this->_getMessage($exception)); <ide> } <ide> <add> /** <add> * Get the request context for an error/exception trace. <add> * <add> * @param \Cake\Network\Request $request The request to read from. <add> * @return string <add> */ <add> protected function _requestContext($request) <add> { <add> $message = "\nRequest URL: " . $request->here(); <add> <add> $referer = $request->env('HTTP_REFERER'); <add> if ($referer) { <add> $message .= "\nReferer URL: " . $referer; <add> } <add> $clientIp = $request->clientIp(); <add> if ($clientIp && $clientIp !== '::1') { <add> $message .= "\nClient IP: " . $clientIp; <add> } <add> return $message; <add> } <add> <ide> /** <ide> * Generates a formatted error message <ide> * <ide> protected function _getMessage(Exception $exception) <ide> <ide> $request = Router::getRequest(); <ide> if ($request) { <del> $message .= "\nRequest URL: " . $request->here(); <del> <del> $referer = $request->env('HTTP_REFERER'); <del> if ($referer) { <del> $message .= "\nReferer URL: " . $referer; <del> } <del> <del> $clientIp = $request->clientIp(); <del> if ($clientIp && $clientIp !== '::1') { <del> $message .= "\nClient IP: " . $clientIp; <del> } <add> $message .= $this->_requestContext($request); <ide> } <ide> <ide> if (!empty($config['trace'])) { <ide><path>tests/TestCase/Error/ErrorHandlerTest.php <ide> public function testHandleErrorLoggingTrace() <ide> $this->logicalAnd( <ide> $this->stringContains('Notice (8): Undefined variable: out in '), <ide> $this->stringContains('Trace:'), <del> $this->stringContains(__NAMESPACE__ . '\ErrorHandlerTest::testHandleErrorLoggingTrace()') <add> $this->stringContains(__NAMESPACE__ . '\ErrorHandlerTest::testHandleErrorLoggingTrace()'), <add> $this->stringContains('Request URL:'), <add> $this->stringContains('Referer URL:') <ide> ) <ide> ); <ide>
2
Java
Java
fix javadoc checkstyle issues
e0480f75ac4e0367a053eabd3a07c3fa34eccf61
<ide><path>spring-aop/src/main/java/org/springframework/aop/MethodBeforeAdvice.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * Advice invoked before a method is invoked. Such advices cannot <ide> * prevent the method call proceeding, unless they throw a Throwable. <ide> * <add> * @author Rod Johnson <ide> * @see AfterReturningAdvice <ide> * @see ThrowsAdvice <del> * <del> * @author Rod Johnson <ide> */ <ide> public interface MethodBeforeAdvice extends BeforeAdvice { <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java <ide> public static JoinPoint currentJoinPoint() { <ide> <ide> /** <ide> * This will be non-null if the creator of this advice object knows the argument names <del> * and sets them explicitly <add> * and sets them explicitly. <ide> */ <ide> @Nullable <ide> private String[] argumentNames; <ide> <del> /** Non-null if after throwing advice binds the thrown value */ <add> /** Non-null if after throwing advice binds the thrown value. */ <ide> @Nullable <ide> private String throwingName; <ide> <del> /** Non-null if after returning advice binds the return value */ <add> /** Non-null if after returning advice binds the return value. */ <ide> @Nullable <ide> private String returningName; <ide> <ide> public static JoinPoint currentJoinPoint() { <ide> <ide> /** <ide> * Index for thisJoinPoint argument (currently only <del> * supported at index 0 if present at all) <add> * supported at index 0 if present at all). <ide> */ <ide> private int joinPointArgumentIndex = -1; <ide> <ide> /** <ide> * Index for thisJoinPointStaticPart argument (currently only <del> * supported at index 0 if present at all) <add> * supported at index 0 if present at all). <ide> */ <ide> private int joinPointStaticPartArgumentIndex = -1; <ide> <ide> private void configurePointcutParameters(String[] argumentNames, int argumentInd <ide> <ide> /** <ide> * Take the arguments at the method execution join point and output a set of arguments <del> * to the advice method <add> * to the advice method. <ide> * @param jp the current JoinPoint <ide> * @param jpMatch the join point match that matched this execution join point <ide> * @param returnValue the return value from the method execution (may be null) <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov <ide> } <ide> <ide> <del> /** The pointcut expression associated with the advice, as a simple String */ <add> /** The pointcut expression associated with the advice, as a simple String. */ <ide> @Nullable <ide> private String pointcutExpression; <ide> <ide> private boolean raiseExceptions; <ide> <del> /** If the advice is afterReturning, and binds the return value, this is the parameter name used */ <add> /** If the advice is afterReturning, and binds the return value, this is the parameter name used. */ <ide> @Nullable <ide> private String returningName; <ide> <del> /** If the advice is afterThrowing, and binds the thrown value, this is the parameter name used */ <add> /** If the advice is afterThrowing, and binds the thrown value, this is the parameter name used. */ <ide> @Nullable <ide> private String throwingName; <ide> <ide> public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov <ide> <ide> <ide> /** <del> * Create a new discoverer that attempts to discover parameter names <add> * Create a new discoverer that attempts to discover parameter names. <ide> * from the given pointcut expression. <ide> */ <ide> public AspectJAdviceParameterNameDiscoverer(@Nullable String pointcutExpression) { <ide> private PointcutBody getPointcutBody(String[] tokens, int startIndex) { <ide> } <ide> <ide> /** <del> * Match up args against unbound arguments of primitive types <add> * Match up args against unbound arguments of primitive types. <ide> */ <ide> private void maybeBindPrimitiveArgsFromPointcutExpression() { <ide> int numUnboundPrimitives = countNumberOfUnboundPrimitiveArguments(); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJPointcutAdvisor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class AspectJPointcutAdvisor implements PointcutAdvisor, Ordered { <ide> <ide> <ide> /** <del> * Create a new AspectJPointcutAdvisor for the given advice <add> * Create a new AspectJPointcutAdvisor for the given advice. <ide> * @param advice the AbstractAspectJAdvice to wrap <ide> */ <ide> public AspectJPointcutAdvisor(AbstractAspectJAdvice advice) { <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJProxyUtils.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class AspectJProxyUtils { <ide> * This will expose the current Spring AOP invocation (necessary for some AspectJ pointcut matching) <ide> * and make available the current AspectJ JoinPoint. The call will have no effect if there are no <ide> * AspectJ advisors in the advisor chain. <del> * @param advisors Advisors available <del> * @return {@code true} if any special {@link Advisor Advisors} were added, otherwise {@code false}. <add> * @param advisors the advisors available <add> * @return {@code true} if any special {@link Advisor Advisors} were added, otherwise {@code false} <ide> */ <ide> public static boolean makeAdvisorChainAspectJCapableIfNecessary(List<Advisor> advisors) { <ide> // Don't add advisors to an empty list; may indicate that proxying is just not required <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java <ide> public DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Object <ide> <ide> /** <ide> * Private constructor to share common code between impl-based delegate and reference-based delegate <del> * (cannot use method such as init() to share common code, due the use of final fields) <add> * (cannot use method such as init() to share common code, due the use of final fields). <ide> * @param interfaceType static field defining the introduction <ide> * @param typePattern type pattern the introduction is restricted to <ide> * @param interceptor the delegation advice as {@link IntroductionInterceptor} <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java <ide> public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint, <ide> @Nullable <ide> private Object[] args; <ide> <del> /** Lazily initialized signature object */ <add> /** Lazily initialized signature object. */ <ide> @Nullable <ide> private Signature signature; <ide> <del> /** Lazily initialized source location object */ <add> /** Lazily initialized source location object. */ <ide> @Nullable <ide> private SourceLocation sourceLocation; <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * migrate to {@code ShadowMatch.getVariablesInvolvedInRuntimeTest()} <ide> * or some similar operation. <ide> * <del> * <p>See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=151593"/>Bug 151593</a> <add> * <p>See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=151593">Bug 151593</a> <ide> * <ide> * @author Adrian Colyer <ide> * @author Ramnivas Laddad <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac <ide> private static final String AJC_MAGIC = "ajc$"; <ide> <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> protected final ParameterNameDiscoverer parameterNameDiscoverer = new AspectJAnnotationParameterNameDiscoverer(); <ide> public void validate(Class<?> aspectClass) throws AopConfigException { <ide> <ide> /** <ide> * Find and return the first AspectJ annotation on the given method <del> * (there <i>should</i> only be one anyway...) <add> * (there <i>should</i> only be one anyway...). <ide> */ <ide> @SuppressWarnings("unchecked") <ide> @Nullable <ide> private static <A extends Annotation> AspectJAnnotation<A> findAnnotation(Method <ide> } <ide> <ide> <add> /** <add> * AspectJ annotation types. <add> */ <ide> protected enum AspectJAnnotationType { <ide> <ide> AtPointcut, <ide> protected enum AspectJAnnotationType { <ide> /** <ide> * Class modelling an AspectJ annotation, exposing its type enumeration and <ide> * pointcut String. <add> * @param <A> the annotation type <ide> */ <ide> protected static class AspectJAnnotation<A extends Annotation> { <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java <ide> @SuppressWarnings("serial") <ide> public class AspectJProxyFactory extends ProxyCreatorSupport { <ide> <del> /** Cache for singleton aspect instances */ <add> /** Cache for singleton aspect instances. */ <ide> private static final Map<Class<?>, Object> aspectCache = new ConcurrentHashMap<>(); <ide> <ide> private final AspectJAdvisorFactory aspectFactory = new ReflectiveAspectJAdvisorFactory(); <ide><path>spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst <ide> * Create a BeanFactoryAspectInstanceFactory. AspectJ will be called to <ide> * introspect to create AJType metadata using the type returned for the <ide> * given bean name from the BeanFactory. <del> * @param beanFactory BeanFactory to obtain instance(s) from <add> * @param beanFactory the BeanFactory to obtain instance(s) from <ide> * @param name name of the bean <ide> */ <ide> public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name) { <ide> public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name) { <ide> * Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should <ide> * introspect to create AJType metadata. Use if the BeanFactory may consider the type <ide> * to be a subclass (as when using CGLIB), and the information should relate to a superclass. <del> * @param beanFactory BeanFactory to obtain instance(s) from <add> * @param beanFactory the BeanFactory to obtain instance(s) from <ide> * @param name the name of the bean <ide> * @param type the type that should be introspected by AspectJ <ide> * ({@code null} indicates resolution through {@link BeanFactory#getType} via the bean name) <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> protected ProxyFactory prepareProxyFactory(Object bean, String beanName) { <ide> * Subclasses may choose to implement this: for example, <ide> * to change the interfaces exposed. <ide> * <p>The default implementation is empty. <del> * @param proxyFactory ProxyFactory that is already configured with <add> * @param proxyFactory the ProxyFactory that is already configured with <ide> * target, advisor and interfaces and will be used to create the proxy <ide> * immediately after this method returns <ide> * @since 4.2.3 <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig <ide> @Nullable <ide> private Object[] postInterceptors; <ide> <del> /** Default is global AdvisorAdapterRegistry */ <add> /** Default is global AdvisorAdapterRegistry. */ <ide> private AdvisorAdapterRegistry advisorAdapterRegistry = GlobalAdvisorAdapterRegistry.getInstance(); <ide> <ide> @Nullable <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/Advised.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface Advised extends TargetClassAware { <ide> * or -1 if no such advice is an advice for this proxy. <ide> * <p>The return value of this method can be used to index into <ide> * the advisors array. <del> * @param advice AOP Alliance advice to search for <add> * @param advice the AOP Alliance advice to search for <ide> * @return index from 0 of this advice, or -1 if there's no such advice <ide> */ <ide> int indexOf(Advice advice); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java <ide> */ <ide> public class AdvisedSupport extends ProxyConfig implements Advised { <ide> <del> /** use serialVersionUID from Spring 2.0 for interoperability */ <add> /** use serialVersionUID from Spring 2.0 for interoperability. */ <ide> private static final long serialVersionUID = 2651364800145442165L; <ide> <ide> <ide> public class AdvisedSupport extends ProxyConfig implements Advised { <ide> public static final TargetSource EMPTY_TARGET_SOURCE = EmptyTargetSource.INSTANCE; <ide> <ide> <del> /** Package-protected to allow direct access for efficiency */ <add> /** Package-protected to allow direct access for efficiency. */ <ide> TargetSource targetSource = EMPTY_TARGET_SOURCE; <ide> <del> /** Whether the Advisors are already filtered for the specific target class */ <add> /** Whether the Advisors are already filtered for the specific target class. */ <ide> private boolean preFiltered = false; <ide> <del> /** The AdvisorChainFactory to use */ <add> /** The AdvisorChainFactory to use. */ <ide> AdvisorChainFactory advisorChainFactory = new DefaultAdvisorChainFactory(); <ide> <del> /** Cache with Method as key and advisor chain List as value */ <add> /** Cache with Method as key and advisor chain List as value. */ <ide> private transient Map<MethodCacheKey, List<Object>> methodCache; <ide> <ide> /** <ide> public int countAdvicesOfType(@Nullable Class<?> adviceClass) { <ide> * for the given method, based on this configuration. <ide> * @param method the proxied method <ide> * @param targetClass the target class <del> * @return List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers) <add> * @return a List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers) <ide> */ <ide> public List<Object> getInterceptorsAndDynamicInterceptionAdvice(Method method, @Nullable Class<?> targetClass) { <ide> MethodCacheKey cacheKey = new MethodCacheKey(method); <ide> protected void copyConfigurationFrom(AdvisedSupport other, TargetSource targetSo <ide> <ide> /** <ide> * Build a configuration-only copy of this AdvisedSupport, <del> * replacing the TargetSource <add> * replacing the TargetSource. <ide> */ <ide> AdvisedSupport getConfigurationOnlyCopy() { <ide> AdvisedSupport copy = new AdvisedSupport(); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/AdvisorChainFactory.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface AdvisorChainFactory { <ide> * @param method the proxied method <ide> * @param targetClass the target class (may be {@code null} to indicate a proxy without <ide> * target object, in which case the method's declaring class is the next best option) <del> * @return List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers) <add> * @return a List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers) <ide> */ <ide> List<Object> getInterceptorsAndDynamicInterceptionAdvice(Advised config, Method method, @Nullable Class<?> targetClass); <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/AopContext.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class AopContext { <ide> * Try to return the current AOP proxy. This method is usable only if the <ide> * calling method has been invoked via AOP, and the AOP framework has been set <ide> * to expose proxies. Otherwise, this method will throw an IllegalStateException. <del> * @return Object the current AOP proxy (never returns {@code null}) <add> * @return the current AOP proxy (never returns {@code null}) <ide> * @throws IllegalStateException if the proxy cannot be found, because the <ide> * method was invoked outside an AOP invocation context, or because the <ide> * AOP framework has not been configured to expose the proxy <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java <ide> class CglibAopProxy implements AopProxy, Serializable { <ide> private static final int INVOKE_HASHCODE = 6; <ide> <ide> <del> /** Logger available to subclasses; static to optimize serialization */ <add> /** Logger available to subclasses; static to optimize serialization. */ <ide> protected static final Log logger = LogFactory.getLog(CglibAopProxy.class); <ide> <del> /** Keeps track of the Classes that we have validated for final methods */ <add> /** Keeps track of the Classes that we have validated for final methods. */ <ide> private static final Map<Class<?>, Boolean> validatedClasses = new WeakHashMap<>(); <ide> <ide> <del> /** The configuration used to configure this proxy */ <add> /** The configuration used to configure this proxy. */ <ide> protected final AdvisedSupport advised; <ide> <ide> @Nullable <ide> class CglibAopProxy implements AopProxy, Serializable { <ide> @Nullable <ide> protected Class<?>[] constructorArgTypes; <ide> <del> /** Dispatcher used for methods on Advised */ <add> /** Dispatcher used for methods on Advised. */ <ide> private final transient AdvisedDispatcher advisedDispatcher; <ide> <ide> private transient Map<String, Integer> fixedInterceptorMap = Collections.emptyMap(); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializable { <ide> <del> /** use serialVersionUID from Spring 1.2 for interoperability */ <add> /** use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = 5531744639992436476L; <ide> <ide> <ide> final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa <ide> * This way, we can also more easily take advantage of minor optimizations in each class. <ide> */ <ide> <del> /** We use a static Log to avoid serialization issues */ <add> /** We use a static Log to avoid serialization issues. */ <ide> private static final Log logger = LogFactory.getLog(JdkDynamicAopProxy.class); <ide> <del> /** Config used to configure this proxy */ <add> /** Config used to configure this proxy. */ <ide> private final AdvisedSupport advised; <ide> <ide> /** <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/ProxyConfig.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class ProxyConfig implements Serializable { <ide> <del> /** use serialVersionUID from Spring 1.2 for interoperability */ <add> /** use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = -8409359707199703185L; <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/ProxyCreatorSupport.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class ProxyCreatorSupport extends AdvisedSupport { <ide> <ide> private List<AdvisedSupportListener> listeners = new LinkedList<>(); <ide> <del> /** Set to true when the first AOP proxy has been created */ <add> /** Set to true when the first AOP proxy has been created. */ <ide> private boolean active = false; <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class ProxyFactoryBean extends ProxyCreatorSupport <ide> @Nullable <ide> private transient BeanFactory beanFactory; <ide> <del> /** Whether the advisor chain has already been initialized */ <add> /** Whether the advisor chain has already been initialized. */ <ide> private boolean advisorChainInitialized = false; <ide> <del> /** If this is a singleton, the cached singleton proxy instance */ <add> /** If this is a singleton, the cached singleton proxy instance. */ <ide> @Nullable <ide> private Object singletonInstance; <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/AdvisorAdapterRegistry.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface AdvisorAdapterRegistry { <ide> * given Advisor in an interception-based framework. <ide> * <p>Don't worry about the pointcut associated with the Advisor, <ide> * if it's a PointcutAdvisor: just return an interceptor. <del> * @param advisor Advisor to find an interceptor for <add> * @param advisor the Advisor to find an interceptor for <ide> * @return an array of MethodInterceptors to expose this Advisor's behavior <ide> * @throws UnknownAdviceTypeException if the Advisor type is <ide> * not understood by any registered AdvisorAdapter. <ide> public interface AdvisorAdapterRegistry { <ide> * Register the given AdvisorAdapter. Note that it is not necessary to register <ide> * adapters for an AOP Alliance Interceptors or Spring Advices: these must be <ide> * automatically recognized by an AdvisorAdapterRegistry implementation. <del> * @param adapter AdvisorAdapter that understands a particular Advisor <add> * @param adapter the AdvisorAdapter that understands a particular Advisor <ide> * or Advice types <ide> */ <ide> void registerAdvisorAdapter(AdvisorAdapter adapter); <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class ThrowsAdviceInterceptor implements MethodInterceptor, AfterAdvice { <ide> <ide> private final Object throwsAdvice; <ide> <del> /** Methods on throws advice, keyed by exception class */ <add> /** Methods on throws advice, keyed by exception class. */ <ide> private final Map<Class<?>, Method> exceptionHandlerMap = new HashMap<>(); <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.java <ide> protected List<Advisor> sortAdvisors(List<Advisor> advisors) { <ide> * <p>The default implementation is empty. <ide> * <p>Typically used to add Advisors that expose contextual information <ide> * required by some of the later advisors. <del> * @param candidateAdvisors Advisors that have already been identified as <add> * @param candidateAdvisors the Advisors that have already been identified as <ide> * applying to a given bean <ide> */ <ide> protected void extendAdvisors(List<Advisor> candidateAdvisors) { <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java <ide> public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport <ide> protected static final Object[] PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS = new Object[0]; <ide> <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <del> /** Default is global AdvisorAdapterRegistry */ <add> /** Default is global AdvisorAdapterRegistry. */ <ide> private AdvisorAdapterRegistry advisorAdapterRegistry = GlobalAdvisorAdapterRegistry.getInstance(); <ide> <ide> /** <ide> public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport <ide> */ <ide> private boolean freezeProxy = false; <ide> <del> /** Default is no common interceptors */ <add> /** Default is no common interceptors. */ <ide> private String[] interceptorNames = new String[0]; <ide> <ide> private boolean applyCommonInterceptorsFirst = true; <ide> private Advisor[] resolveInterceptorNames() { <ide> * Subclasses may choose to implement this: for example, <ide> * to change the interfaces exposed. <ide> * <p>The default implementation is empty. <del> * @param proxyFactory ProxyFactory that is already configured with <add> * @param proxyFactory a ProxyFactory that is already configured with <ide> * TargetSource and interfaces and will be used to create the proxy <ide> * immediately after this method returns <ide> */ <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/DefaultAdvisorAutoProxyCreator.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> @SuppressWarnings("serial") <ide> public class DefaultAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator implements BeanNameAware { <ide> <del> /** Separator between prefix and remainder of bean name */ <add> /** Separator between prefix and remainder of bean name. */ <ide> public static final String SEPARATOR = "."; <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/ProxyCreationContext.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class ProxyCreationContext { <ide> <del> /** ThreadLocal holding the current proxied bean name during Advisor matching */ <add> /** ThreadLocal holding the current proxied bean name during Advisor matching. */ <ide> private static final ThreadLocal<String> currentProxiedBeanName = <ide> new NamedThreadLocal<>("Name of currently proxied bean"); <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/AbstractBeanFactoryBasedTargetSourceCreator.java <ide> <ide> private ConfigurableBeanFactory beanFactory; <ide> <del> /** Internally used DefaultListableBeanFactory instances, keyed by bean name */ <add> /** Internally used DefaultListableBeanFactory instances, keyed by bean name. */ <ide> private final Map<String, DefaultListableBeanFactory> internalBeanFactories = <ide> new HashMap<>(); <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/QuickTargetSourceCreator.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class QuickTargetSourceCreator extends AbstractBeanFactoryBasedTargetSourceCreator { <ide> <add> /** <add> * The CommonsPool2TargetSource prefix. <add> */ <ide> public static final String PREFIX_COMMONS_POOL = ":"; <add> <add> /** <add> * The ThreadLocalTargetSource prefix. <add> */ <ide> public static final String PREFIX_THREAD_LOCAL = "%"; <add> <add> /** <add> * The PrototypeTargetSource prefix. <add> */ <ide> public static final String PREFIX_PROTOTYPE = "!"; <ide> <ide> @Override <ide><path>spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeBeanNameAdvisors.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public static String getBeanName() throws IllegalStateException { <ide> /** <ide> * Find the bean name for the given invocation. Assumes that an ExposeBeanNameAdvisor <ide> * has been included in the interceptor chain. <del> * @param mi MethodInvocation that should contain the bean name as an attribute <add> * @param mi the MethodInvocation that should contain the bean name as an attribute <ide> * @return the bean name (never {@code null}) <ide> * @throws IllegalStateException if the bean name has not been exposed <ide> */ <ide> public static String getBeanName(MethodInvocation mi) throws IllegalStateExcepti <ide> <ide> /** <ide> * Create a new advisor that will expose the given bean name, <del> * with no introduction <add> * with no introduction. <ide> * @param beanName bean name to expose <ide> */ <ide> public static Advisor createAdvisorWithoutIntroduction(String beanName) { <ide><path>spring-aop/src/main/java/org/springframework/aop/interceptor/ExposeInvocationInterceptor.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> @SuppressWarnings("serial") <ide> public class ExposeInvocationInterceptor implements MethodInterceptor, PriorityOrdered, Serializable { <ide> <del> /** Singleton instance of this class */ <add> /** Singleton instance of this class. */ <ide> public static final ExposeInvocationInterceptor INSTANCE = new ExposeInvocationInterceptor(); <ide> <ide> /** <ide><path>spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> @SuppressWarnings("serial") <ide> public class ScopedProxyFactoryBean extends ProxyConfig implements FactoryBean<Object>, BeanFactoryAware { <ide> <del> /** The TargetSource that manages scoping */ <add> /** The TargetSource that manages scoping. */ <ide> private final SimpleBeanTargetSource scopedTargetSource = new SimpleBeanTargetSource(); <ide> <del> /** The name of the target bean */ <add> /** The name of the target bean. */ <ide> @Nullable <ide> private String targetBeanName; <ide> <del> /** The cached singleton proxy */ <add> /** The cached singleton proxy. */ <ide> @Nullable <ide> private Object proxy; <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/support/ComposablePointcut.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class ComposablePointcut implements Pointcut, Serializable { <ide> <del> /** use serialVersionUID from Spring 1.2 for interoperability */ <add> /** use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = -2743223737633663832L; <ide> <ide> private ClassFilter classFilter; <ide><path>spring-aop/src/main/java/org/springframework/aop/support/DynamicMethodMatcher.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> /** <ide> * Convenient abstract superclass for dynamic method matchers, <ide> * which do care about arguments at runtime. <add> * <add> * @author Rod Johnson <ide> */ <ide> public abstract class DynamicMethodMatcher implements MethodMatcher { <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class Pointcuts { <ide> <del> /** Pointcut matching all bean property setters, in any class */ <add> /** Pointcut matching all bean property setters, in any class. */ <ide> public static final Pointcut SETTERS = SetterPointcut.INSTANCE; <ide> <del> /** Pointcut matching all bean property getters, in any class */ <add> /** Pointcut matching all bean property getters, in any class. */ <ide> public static final Pointcut GETTERS = GetterPointcut.INSTANCE; <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.aop.ClassFilter; <ide> <ide> /** <del> * Simple ClassFilter implementation that passes classes (and optionally subclasses) <add> * Simple ClassFilter implementation that passes classes (and optionally subclasses). <add> * <ide> * @author Rod Johnson <ide> */ <ide> @SuppressWarnings("serial") <ide><path>spring-aop/src/main/java/org/springframework/aop/support/StaticMethodMatcher.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> /** <ide> * Convenient abstract superclass for static method matchers, which don't care <ide> * about arguments at runtime. <add> * <add> * @author Rod Johnson <ide> */ <ide> public abstract class StaticMethodMatcher implements MethodMatcher { <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/target/AbstractBeanFactoryBasedTargetSource.java <ide> */ <ide> public abstract class AbstractBeanFactoryBasedTargetSource implements TargetSource, BeanFactoryAware, Serializable { <ide> <del> /** use serialVersionUID from Spring 1.2.7 for interoperability */ <add> /** use serialVersionUID from Spring 1.2.7 for interoperability. */ <ide> private static final long serialVersionUID = -4721607536018568393L; <ide> <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <del> /** Name of the target bean we will create on each invocation */ <add> /** Name of the target bean we will create on each invocation. */ <ide> private String targetBeanName; <ide> <del> /** Class of the target */ <add> /** Class of the target. */ <ide> private volatile Class<?> targetClass; <ide> <ide> /** <ide><path>spring-aop/src/main/java/org/springframework/aop/target/AbstractLazyCreationTargetSource.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class AbstractLazyCreationTargetSource implements TargetSource { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <del> /** The lazily initialized target object */ <add> /** The lazily initialized target object. */ <ide> private Object lazyTarget; <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class AbstractPoolingTargetSource extends AbstractPrototypeBasedTargetSource <ide> implements PoolingConfig, DisposableBean { <ide> <del> /** The maximum size of the pool */ <add> /** The maximum size of the pool. */ <ide> private int maxSize = -1; <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/target/CommonsPool2TargetSource.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class CommonsPool2TargetSource extends AbstractPoolingTargetSource implem <ide> private boolean blockWhenExhausted = GenericObjectPoolConfig.DEFAULT_BLOCK_WHEN_EXHAUSTED; <ide> <ide> /** <del> * The Apache Commons {@code ObjectPool} used to pool target objects <add> * The Apache Commons {@code ObjectPool} used to pool target objects. <ide> */ <ide> @Nullable <ide> private ObjectPool pool; <ide><path>spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class EmptyTargetSource implements TargetSource, Serializable { <ide> <del> /** use serialVersionUID from Spring 1.2 for interoperability */ <add> /** use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = 3680494563553489691L; <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/target/HotSwappableTargetSource.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class HotSwappableTargetSource implements TargetSource, Serializable { <ide> <del> /** use serialVersionUID from Spring 1.2 for interoperability */ <add> /** use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = 7497929212653839187L; <ide> <ide> <del> /** The current target object */ <add> /** The current target object. */ <ide> private Object target; <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/target/SingletonTargetSource.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class SingletonTargetSource implements TargetSource, Serializable { <ide> <del> /** use serialVersionUID from Spring 1.2 for interoperability */ <add> /** use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = 9031246629662423738L; <ide> <ide> <del> /** Target cached and invoked using reflection */ <add> /** Target cached and invoked using reflection. */ <ide> private final Object target; <ide> <ide> <ide><path>spring-aop/src/main/java/org/springframework/aop/target/dynamic/AbstractRefreshableTargetSource.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class AbstractRefreshableTargetSource implements TargetSource, Refreshable { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> @Nullable <ide><path>spring-aspects/src/main/java/org/springframework/context/annotation/aspectj/SpringConfiguredConfiguration.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> @Configuration <ide> public class SpringConfiguredConfiguration { <ide> <add> /** <add> * The bean name used for the configurer aspect. <add> */ <ide> public static final String BEAN_CONFIGURER_ASPECT_BEAN_NAME = <ide> "org.springframework.context.config.internalBeanConfigurerAspect"; <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/AbstractNestablePropertyAccessor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA <ide> @Nullable <ide> Object rootObject; <ide> <del> /** Map with cached nested Accessors: nested path -> Accessor instance */ <add> /** Map with cached nested Accessors: nested path -> Accessor instance. */ <ide> @Nullable <ide> private Map<String, AbstractNestablePropertyAccessor> nestedPropertyAccessors; <ide> <ide> public String toString() { <ide> } <ide> <ide> <add> /** <add> * A handler for a specific property. <add> */ <ide> protected abstract static class PropertyHandler { <ide> <ide> private final Class<?> propertyType; <ide> public Class<?> getCollectionType(int nestingLevel) { <ide> } <ide> <ide> <add> /** <add> * Holder class used to store property tokens. <add> */ <ide> protected static class PropertyTokenHolder { <ide> <ide> public PropertyTokenHolder(String name) { <ide><path>spring-beans/src/main/java/org/springframework/beans/BeanUtils.java <ide> else if (startParen == -1) { <ide> <ide> <ide> /** <del> * Retrieve the JavaBeans {@code PropertyDescriptor}s of a given class. <add> * Retrieve the JavaBeans {@code PropertyDescriptor}s of a given <add> * class. <ide> * @param clazz the Class to retrieve the PropertyDescriptors for <ide> * @return an array of {@code PropertyDescriptors} for the given class <ide> * @throws BeansException if PropertyDescriptor look fails <ide><path>spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java <ide> public class BeanWrapperImpl extends AbstractNestablePropertyAccessor implements <ide> private CachedIntrospectionResults cachedIntrospectionResults; <ide> <ide> /** <del> * The security context used for invoking the property methods <add> * The security context used for invoking the property methods. <ide> */ <ide> @Nullable <ide> private AccessControlContext acc; <ide><path>spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java <ide> public class CachedIntrospectionResults { <ide> private static final boolean shouldIntrospectorIgnoreBeaninfoClasses = <ide> SpringProperties.getFlag(IGNORE_BEANINFO_PROPERTY_NAME); <ide> <del> /** Stores the BeanInfoFactory instances */ <add> /** Stores the BeanInfoFactory instances. */ <ide> private static List<BeanInfoFactory> beanInfoFactories = SpringFactoriesLoader.loadFactories( <ide> BeanInfoFactory.class, CachedIntrospectionResults.class.getClassLoader()); <ide> <ide> private static BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionExce <ide> } <ide> <ide> <del> /** The BeanInfo object for the introspected bean class */ <add> /** The BeanInfo object for the introspected bean class. */ <ide> private final BeanInfo beanInfo; <ide> <del> /** PropertyDescriptor objects keyed by property name String */ <add> /** PropertyDescriptor objects keyed by property name String. */ <ide> private final Map<String, PropertyDescriptor> propertyDescriptorCache; <ide> <del> /** TypeDescriptor objects keyed by PropertyDescriptor */ <add> /** TypeDescriptor objects keyed by PropertyDescriptor. */ <ide> private final ConcurrentMap<PropertyDescriptor, TypeDescriptor> typeDescriptorCache; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java <ide> private String propertyNameFor(Method method) { <ide> <ide> <ide> /** <del> * Return the set of {@link PropertyDescriptor}s from the wrapped {@link BeanInfo} <del> * object as well as {@code PropertyDescriptor}s for each non-void returning setter <del> * method found during construction. <add> * Return the set of {@link PropertyDescriptor PropertyDescriptors} from the wrapped <add> * {@link BeanInfo} object as well as {@code PropertyDescriptor BeanInfo} object as well as {@code PropertyDescriptors} <add> * for each non-void returning setter method found during construction. <ide> * @see #ExtendedBeanInfo(BeanInfo) <ide> */ <ide> @Override <ide> public MethodDescriptor[] getMethodDescriptors() { <ide> } <ide> <ide> <add> /** <add> * A simple {@link PropertyDescriptor}. <add> */ <ide> static class SimplePropertyDescriptor extends PropertyDescriptor { <ide> <ide> @Nullable <ide> public String toString() { <ide> } <ide> <ide> <add> /** <add> * A simple {@link IndexedPropertyDescriptor}. <add> */ <ide> static class SimpleIndexedPropertyDescriptor extends IndexedPropertyDescriptor { <ide> <ide> @Nullable <ide><path>spring-beans/src/main/java/org/springframework/beans/MethodInvocationException.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class MethodInvocationException extends PropertyAccessException { <ide> <ide> /** <ide> * Create a new MethodInvocationException. <del> * @param propertyChangeEvent PropertyChangeEvent that resulted in an exception <add> * @param propertyChangeEvent the PropertyChangeEvent that resulted in an exception <ide> * @param cause the Throwable raised by the invoked method <ide> */ <ide> public MethodInvocationException(PropertyChangeEvent propertyChangeEvent, Throwable cause) { <ide><path>spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java <ide> public MutablePropertyValues(@Nullable PropertyValues original) { <ide> <ide> /** <ide> * Construct a new MutablePropertyValues object from a Map. <del> * @param original Map with property values keyed by property name Strings <add> * @param original a Map with property values keyed by property name Strings <ide> * @see #addPropertyValues(Map) <ide> */ <ide> public MutablePropertyValues(@Nullable Map<?, ?> original) { <ide> public MutablePropertyValues(@Nullable Map<?, ?> original) { <ide> * PropertyValue objects as-is. <ide> * <p>This is a constructor for advanced usage scenarios. <ide> * It is not intended for typical programmatic use. <del> * @param propertyValueList List of PropertyValue objects <add> * @param propertyValueList a List of PropertyValue objects <ide> */ <ide> public MutablePropertyValues(@Nullable List<PropertyValue> propertyValueList) { <ide> this.propertyValueList = <ide> public MutablePropertyValues addPropertyValues(@Nullable PropertyValues other) { <ide> <ide> /** <ide> * Add all property values from the given Map. <del> * @param other Map with property values keyed by property name, <add> * @param other a Map with property values keyed by property name, <ide> * which must be a String <ide> * @return this in order to allow for adding multiple property values in a chain <ide> */ <ide> public MutablePropertyValues addPropertyValues(@Nullable Map<?, ?> other) { <ide> /** <ide> * Add a PropertyValue object, replacing any existing one for the <ide> * corresponding property or getting merged with it (if applicable). <del> * @param pv PropertyValue object to add <add> * @param pv the PropertyValue object to add <ide> * @return this in order to allow for adding multiple property values in a chain <ide> */ <ide> public MutablePropertyValues addPropertyValue(PropertyValue pv) { <ide><path>spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface PropertyAccessor { <ide> * Follows normal Java conventions: getFoo().getBar() would be "foo.bar". <ide> */ <ide> String NESTED_PROPERTY_SEPARATOR = "."; <add> <add> /** <add> * Path separator for nested properties. <add> * Follows normal Java conventions: getFoo().getBar() would be "foo.bar". <add> */ <ide> char NESTED_PROPERTY_SEPARATOR_CHAR = '.'; <ide> <ide> /** <ide> * Marker that indicates the start of a property key for an <ide> * indexed or mapped property like "person.addresses[0]". <ide> */ <ide> String PROPERTY_KEY_PREFIX = "["; <add> <add> /** <add> * Marker that indicates the start of a property key for an <add> * indexed or mapped property like "person.addresses[0]". <add> */ <ide> char PROPERTY_KEY_PREFIX_CHAR = '['; <ide> <ide> /** <ide> * Marker that indicates the end of a property key for an <ide> * indexed or mapped property like "person.addresses[0]". <ide> */ <ide> String PROPERTY_KEY_SUFFIX = "]"; <add> <add> /** <add> * Marker that indicates the end of a property key for an <add> * indexed or mapped property like "person.addresses[0]". <add> */ <ide> char PROPERTY_KEY_SUFFIX_CHAR = ']'; <ide> <ide> <ide> public interface PropertyAccessor { <ide> * <p>Bulk updates from PropertyValues are more powerful: This method is <ide> * provided for convenience. Behavior will be identical to that of <ide> * the {@link #setPropertyValues(PropertyValues)} method. <del> * @param map Map to take properties from. Contains property value objects, <add> * @param map a Map to take properties from. Contains property value objects, <ide> * keyed by property name <ide> * @throws InvalidPropertyException if there is no such property or <ide> * if the property isn't writable <ide> public interface PropertyAccessor { <ide> * This exception can be examined later to see all binding errors. <ide> * Properties that were successfully updated remain changed. <ide> * <p>Does not allow unknown fields or invalid fields. <del> * @param pvs PropertyValues to set on the target object <add> * @param pvs a PropertyValues to set on the target object <ide> * @throws InvalidPropertyException if there is no such property or <ide> * if the property isn't writable <ide> * @throws PropertyBatchUpdateException if one or more PropertyAccessExceptions <ide> public interface PropertyAccessor { <ide> * {@link PropertyBatchUpdateException} containing all the individual errors. <ide> * This exception can be examined later to see all binding errors. <ide> * Properties that were successfully updated remain changed. <del> * @param pvs PropertyValues to set on the target object <add> * @param pvs a PropertyValues to set on the target object <ide> * @param ignoreUnknown should we ignore unknown properties (not found in the bean) <ide> * @throws InvalidPropertyException if there is no such property or <ide> * if the property isn't writable <ide> void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown) <ide> * {@link PropertyBatchUpdateException} containing all the individual errors. <ide> * This exception can be examined later to see all binding errors. <ide> * Properties that were successfully updated remain changed. <del> * @param pvs PropertyValues to set on the target object <add> * @param pvs a PropertyValues to set on the target object <ide> * @param ignoreUnknown should we ignore unknown properties (not found in the bean) <ide> * @param ignoreInvalid should we ignore invalid properties (found but not accessible) <ide> * @throws InvalidPropertyException if there is no such property or <ide><path>spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> @SuppressWarnings("serial") <ide> public class PropertyBatchUpdateException extends BeansException { <ide> <del> /** List of PropertyAccessException objects */ <add> /** List of PropertyAccessException objects. */ <ide> private PropertyAccessException[] propertyAccessExceptions; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/PropertyMatches.java <ide> */ <ide> public abstract class PropertyMatches { <ide> <del> /** Default maximum property distance: 2 */ <add> /** Default maximum property distance: 2. */ <ide> public static final int DEFAULT_MAX_DISTANCE = 2; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/PropertyValue.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class PropertyValue extends BeanMetadataAttributeAccessor implements Seri <ide> @Nullable <ide> private Object convertedValue; <ide> <del> /** Package-visible field that indicates whether conversion is necessary */ <add> /** Package-visible field that indicates whether conversion is necessary. */ <ide> @Nullable <ide> volatile Boolean conversionNecessary; <ide> <del> /** Package-visible field for caching the resolved property path tokens */ <add> /** Package-visible field for caching the resolved property path tokens. */ <ide> @Nullable <ide> transient volatile Object resolvedTokens; <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/PropertyValues.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface PropertyValues { <ide> * Return the changes since the previous PropertyValues. <ide> * Subclasses should also override {@code equals}. <ide> * @param old old property values <del> * @return PropertyValues updated or new properties. <add> * @return the updated or new properties. <ide> * Return empty PropertyValues if there are no changes. <ide> * @see Object#equals <ide> */ <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/BeanNotOfRequiredTypeException.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> @SuppressWarnings("serial") <ide> public class BeanNotOfRequiredTypeException extends BeansException { <ide> <del> /** The name of the instance that was of the wrong type */ <add> /** The name of the instance that was of the wrong type. */ <ide> private String beanName; <ide> <del> /** The required type */ <add> /** The required type. */ <ide> private Class<?> requiredType; <ide> <del> /** The offending type */ <add> /** The offending type. */ <ide> private Class<?> actualType; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Rod Johnson <ide> * @author Juergen Hoeller <ide> * @since 08.03.2003 <add> * @param <T> the bean type <ide> * @see org.springframework.beans.factory.BeanFactory <ide> * @see org.springframework.aop.framework.ProxyFactoryBean <ide> * @see org.springframework.jndi.JndiObjectFactoryBean <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/ObjectFactory.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Colin Sampaleanu <ide> * @since 1.0.2 <add> * @param <T> the object type <ide> * @see FactoryBean <ide> */ <ide> @FunctionalInterface <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Juergen Hoeller <ide> * @since 4.3 <add> * @param <T> the object type <ide> */ <ide> public interface ObjectProvider<T> extends ObjectFactory<T> { <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/SmartFactoryBean.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Juergen Hoeller <ide> * @since 2.0.3 <add> * @param <T> the bean type <ide> * @see #isPrototype() <ide> * @see #isSingleton() <ide> */ <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/annotation/InjectionMetadata.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public void inject(Object target, @Nullable String beanName, @Nullable PropertyV <ide> } <ide> <ide> /** <add> * Clear property skipping for the contained elements. <ide> * @since 3.2.13 <ide> */ <ide> public void clear(@Nullable PropertyValues pvs) { <ide> public static boolean needsRefresh(@Nullable InjectionMetadata metadata, Class<? <ide> } <ide> <ide> <add> /** <add> * A single injected element. <add> */ <ide> public abstract static class InjectedElement { <ide> <ide> protected final Member member; <ide> else if (pvs instanceof MutablePropertyValues) { <ide> } <ide> <ide> /** <add> * Clear property skipping for this element. <ide> * @since 3.2.13 <ide> */ <ide> protected void clearPropertySkipping(@Nullable PropertyValues pvs) { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java <ide> public class RequiredAnnotationBeanPostProcessor extends InstantiationAwareBeanP <ide> private ConfigurableListableBeanFactory beanFactory; <ide> <ide> /** <del> * Cache for validated bean names, skipping re-validation for the same bean <add> * Cache for validated bean names, skipping re-validation for the same bean. <ide> */ <ide> private final Set<String> validatedBeanNames = Collections.newSetFromMap(new ConcurrentHashMap<>(64)); <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java <ide> * @author Juergen Hoeller <ide> * @author Keith Donald <ide> * @since 1.0.2 <add> * @param <T> the bean type <ide> * @see #setSingleton <ide> * @see #createInstance() <ide> */ <ide> public abstract class AbstractFactoryBean<T> <ide> implements FactoryBean<T>, BeanClassLoaderAware, BeanFactoryAware, InitializingBean, DisposableBean { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> private boolean singleton = true; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/AutowireCapableBeanFactory.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface AutowireCapableBeanFactory extends BeanFactory { <ide> * {@link BeanPostProcessor BeanPostProcessors}. <ide> * <p>Note: This is intended for creating a fresh instance, populating annotated <ide> * fields and methods as well as applying all standard bean initialization callbacks. <del> * It does <i>not</> imply traditional by-name or by-type autowiring of properties; <add> * It does <i>not</i> imply traditional by-name or by-type autowiring of properties; <ide> * use {@link #createBean(Class, int, boolean)} for those purposes. <ide> * @param beanClass the class of the bean to create <ide> * @return the new bean instance <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java <ide> public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single <ide> * bean property values, constructor argument values, etc. <ide> * <p>This will override the default PropertyEditor mechanism and hence make <ide> * any custom editors or custom editor registrars irrelevant. <add> * @since 2.5 <ide> * @see #addPropertyEditorRegistrar <ide> * @see #registerCustomEditor <del> * @since 2.5 <ide> */ <ide> void setTypeConverter(TypeConverter typeConverter); <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * <p> <ide> * Note, that you shouldn't register {@link PropertyEditor} bean instances via <del> * the {@code customEditors} property as {@link PropertyEditor}s are stateful <add> * the {@code customEditors} property as {@link PropertyEditor PropertyEditors} are stateful <ide> * and the instances will then have to be synchronized for every editing <ide> * attempt. In case you need control over the instantiation process of <del> * {@link PropertyEditor}s, use a {@link PropertyEditorRegistrar} to register <add> * {@link PropertyEditor PropertyEditors}, use a {@link PropertyEditorRegistrar} to register <ide> * them. <ide> * <ide> * <p> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * <p>Typically used for retrieving public static final constants. Usage example: <ide> * <del> * <pre class="code">// standard definition for exposing a static field, specifying the "staticField" property <add> * <pre class="code"> <add> * // standard definition for exposing a static field, specifying the "staticField" property <ide> * &lt;bean id="myField" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"&gt; <ide> * &lt;property name="staticField" value="java.sql.Connection.TRANSACTION_SERIALIZABLE"/&gt; <ide> * &lt;/bean&gt; <ide> * <ide> * // convenience version that specifies a static field pattern as bean name <ide> * &lt;bean id="java.sql.Connection.TRANSACTION_SERIALIZABLE" <del> * class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/&gt;</pre> <add> * class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/&gt; <ide> * </pre> <ide> * <ide> * <p>If you are using Spring 2.0, you can also use the following style of configuration for <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class MethodInvokingFactoryBean extends MethodInvokingBean implements Fac <ide> <ide> private boolean initialized = false; <ide> <del> /** Method call result in the singleton case */ <add> /** Method call result in the singleton case. */ <ide> @Nullable <ide> private Object singletonObject; <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/NamedBeanHolder.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Juergen Hoeller <ide> * @since 4.3.3 <add> * @param <T> the bean type <ide> * @see AutowireCapableBeanFactory#resolveNamedBean(Class) <ide> */ <ide> public class NamedBeanHolder<T> implements NamedBean { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * Example XML bean definition: <ide> * <ide> * <pre class="code"> <del> * <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/> <del> * <property name="driverClassName" value="${driver}"/> <del> * <property name="url" value="jdbc:${dbname}"/> <del> * </bean> <add> * &lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/&gt; <add> * &lt;property name="driverClassName" value="${driver}"/&gt; <add> * &lt;property name="url" value="jdbc:${dbname}"/&gt; <add> * &lt;/bean&gt; <ide> * </pre> <ide> * <ide> * Example properties file: <ide> public abstract class PlaceholderConfigurerSupport extends PropertyResourceConfigurer <ide> implements BeanNameAware, BeanFactoryAware { <ide> <del> /** Default placeholder prefix: {@value} */ <add> /** Default placeholder prefix: {@value}. */ <ide> public static final String DEFAULT_PLACEHOLDER_PREFIX = "${"; <ide> <del> /** Default placeholder suffix: {@value} */ <add> /** Default placeholder suffix: {@value}. */ <ide> public static final String DEFAULT_PLACEHOLDER_SUFFIX = "}"; <ide> <del> /** Default value separator: {@value} */ <add> /** Default value separator: {@value}. */ <ide> public static final String DEFAULT_VALUE_SEPARATOR = ":"; <ide> <ide> <del> /** Defaults to {@value #DEFAULT_PLACEHOLDER_PREFIX} */ <add> /** Defaults to {@value #DEFAULT_PLACEHOLDER_PREFIX}. */ <ide> protected String placeholderPrefix = DEFAULT_PLACEHOLDER_PREFIX; <ide> <del> /** Defaults to {@value #DEFAULT_PLACEHOLDER_SUFFIX} */ <add> /** Defaults to {@value #DEFAULT_PLACEHOLDER_SUFFIX}. */ <ide> protected String placeholderSuffix = DEFAULT_PLACEHOLDER_SUFFIX; <ide> <del> /** Defaults to {@value #DEFAULT_VALUE_SEPARATOR} */ <add> /** Defaults to {@value #DEFAULT_VALUE_SEPARATOR}. */ <ide> @Nullable <ide> protected String valueSeparator = DEFAULT_VALUE_SEPARATOR; <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyOverrideConfigurer.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class PropertyOverrideConfigurer extends PropertyResourceConfigurer { <ide> <add> /** <add> * The default bean name separator. <add> */ <ide> public static final String DEFAULT_BEAN_NAME_SEPARATOR = "."; <ide> <ide> <ide> public class PropertyOverrideConfigurer extends PropertyResourceConfigurer { <ide> private boolean ignoreInvalidKeys = false; <ide> <ide> /** <del> * Contains names of beans that have overrides <add> * Contains names of beans that have overrides. <ide> */ <ide> private final Set<String> beanNames = Collections.newSetFromMap(new ConcurrentHashMap<>(16)); <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java <ide> public abstract class YamlProcessor { <ide> /** <ide> * A map of document matchers allowing callers to selectively use only <ide> * some of the documents in a YAML resource. In YAML documents are <del> * separated by <code>---<code> lines, and each document is converted <add> * separated by {@code ---} lines, and each document is converted <ide> * to properties before the match is made. E.g. <ide> * <pre class="code"> <ide> * environment: dev <ide> public interface DocumentMatcher { <ide> <ide> <ide> /** <del> * Status returned from {@link DocumentMatcher#matches(java.util.Properties)} <add> * Status returned from {@link DocumentMatcher#matches(java.util.Properties)}. <ide> */ <ide> public enum MatchStatus { <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java <ide> else if (constructorArgs[i] instanceof Map){ <ide> } <ide> <ide> /** <del> * Checks whether there are any {@link RuntimeBeanReference}s inside the {@link Map} <del> * and converts it to a {@link ManagedMap} if necessary. <add> * Checks whether there are any {@link RuntimeBeanReference RuntimeBeanReferences} <add> * inside the {@link Map} and converts it to a {@link ManagedMap} if necessary. <ide> * @param map the original Map <ide> * @return either the original map or a managed copy of it <ide> */ <ide> private Object manageMapIfNecessary(Map<?, ?> map) { <ide> } <ide> <ide> /** <del> * Checks whether there are any {@link RuntimeBeanReference}s inside the {@link List} <del> * and converts it to a {@link ManagedList} if necessary. <add> * Checks whether there are any {@link RuntimeBeanReference RuntimeBeanReferences} <add> * inside the {@link List} and converts it to a {@link ManagedList} if necessary. <ide> * @param list the original List <ide> * @return either the original list or a managed copy of it <ide> */ <ide> else if (value instanceof Closure) { <ide> <ide> /** <ide> * This method overrides property retrieval in the scope of the <del> * {@code GroovyBeanDefinitionReader} to either: <add> * {@code GroovyBeanDefinitionReader}. A property retrieval will either: <ide> * <ul> <ide> * <li>Retrieve a variable from the bean builder's binding if it exists <ide> * <li>Retrieve a RuntimeBeanReference for a specific bean if it exists <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java <ide> public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFactory <ide> implements AutowireCapableBeanFactory { <ide> <del> /** Strategy for creating bean instances */ <add> /** Strategy for creating bean instances. */ <ide> private InstantiationStrategy instantiationStrategy = new CglibSubclassingInstantiationStrategy(); <ide> <del> /** Resolver strategy for method parameter names */ <add> /** Resolver strategy for method parameter names. */ <ide> @Nullable <ide> private ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer(); <ide> <del> /** Whether to automatically try to resolve circular references between beans */ <add> /** Whether to automatically try to resolve circular references between beans. */ <ide> private boolean allowCircularReferences = true; <ide> <ide> /** <ide> public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac <ide> */ <ide> private final NamedThreadLocal<String> currentlyCreatedBean = new NamedThreadLocal<>("Currently created bean"); <ide> <del> /** Cache of unfinished FactoryBean instances: FactoryBean name --> BeanWrapper */ <add> /** Cache of unfinished FactoryBean instances: FactoryBean name to BeanWrapper. */ <ide> private final Map<String, BeanWrapper> factoryBeanInstanceCache = new ConcurrentHashMap<>(16); <ide> <del> /** Cache of filtered PropertyDescriptors: bean Class -> PropertyDescriptor array */ <add> /** Cache of filtered PropertyDescriptors: bean Class to PropertyDescriptor array. */ <ide> private final ConcurrentMap<Class<?>, PropertyDescriptor[]> filteredPropertyDescriptorsCache = <ide> new ConcurrentHashMap<>(256); <ide> <ide> protected Class<?> getTypeForFactoryBean(String beanName, RootBeanDefinition mbd <ide> */ <ide> @Nullable <ide> private Class<?> getTypeForFactoryBeanFromMethod(Class<?> beanClass, final String factoryMethodName) { <add> <add> /** <add> * Holder used to keep a reference to a {@code Class} value. <add> */ <ide> class Holder { @Nullable Class<?> value = null; } <add> <ide> final Holder objectType = new Holder(); <ide> <ide> // CGLIB subclass methods hide generic parameters; look at the original user class. <ide> protected BeanWrapper autowireConstructor( <ide> * from the bean definition. <ide> * @param beanName the name of the bean <ide> * @param mbd the bean definition for the bean <del> * @param bw BeanWrapper with bean instance <add> * @param bw the BeanWrapper with bean instance <ide> */ <ide> protected void populateBean(String beanName, RootBeanDefinition mbd, @Nullable BeanWrapper bw) { <ide> if (bw == null) { <ide> protected void populateBean(String beanName, RootBeanDefinition mbd, @Nullable B <ide> * @param beanName the name of the bean we're wiring up. <ide> * Useful for debugging messages; not used functionally. <ide> * @param mbd bean definition to update through autowiring <del> * @param bw BeanWrapper from which we can obtain information about the bean <add> * @param bw the BeanWrapper from which we can obtain information about the bean <ide> * @param pvs the PropertyValues to register wired objects with <ide> */ <ide> protected void autowireByName( <ide> protected void autowireByName( <ide> * behavior for bigger applications. <ide> * @param beanName the name of the bean to autowire by type <ide> * @param mbd the merged bean definition to update through autowiring <del> * @param bw BeanWrapper from which we can obtain information about the bean <add> * @param bw the BeanWrapper from which we can obtain information about the bean <ide> * @param pvs the PropertyValues to register wired objects with <ide> */ <ide> protected void autowireByType( <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable, BeanDefinitionReader { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> private final BeanDefinitionRegistry registry; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java <ide> */ <ide> public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport implements ConfigurableBeanFactory { <ide> <del> /** Parent bean factory, for bean inheritance support */ <add> /** Parent bean factory, for bean inheritance support. */ <ide> @Nullable <ide> private BeanFactory parentBeanFactory; <ide> <del> /** ClassLoader to resolve bean class names with, if necessary */ <add> /** ClassLoader to resolve bean class names with, if necessary. */ <ide> @Nullable <ide> private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); <ide> <del> /** ClassLoader to temporarily resolve bean class names with, if necessary */ <add> /** ClassLoader to temporarily resolve bean class names with, if necessary. */ <ide> @Nullable <ide> private ClassLoader tempClassLoader; <ide> <del> /** Whether to cache bean metadata or rather reobtain it for every access */ <add> /** Whether to cache bean metadata or rather reobtain it for every access. */ <ide> private boolean cacheBeanMetadata = true; <ide> <del> /** Resolution strategy for expressions in bean definition values */ <add> /** Resolution strategy for expressions in bean definition values. */ <ide> @Nullable <ide> private BeanExpressionResolver beanExpressionResolver; <ide> <del> /** Spring ConversionService to use instead of PropertyEditors */ <add> /** Spring ConversionService to use instead of PropertyEditors. */ <ide> @Nullable <ide> private ConversionService conversionService; <ide> <del> /** Custom PropertyEditorRegistrars to apply to the beans of this factory */ <add> /** Custom PropertyEditorRegistrars to apply to the beans of this factory. */ <ide> private final Set<PropertyEditorRegistrar> propertyEditorRegistrars = new LinkedHashSet<>(4); <ide> <del> /** Custom PropertyEditors to apply to the beans of this factory */ <add> /** Custom PropertyEditors to apply to the beans of this factory. */ <ide> private final Map<Class<?>, Class<? extends PropertyEditor>> customEditors = new HashMap<>(4); <ide> <del> /** A custom TypeConverter to use, overriding the default PropertyEditor mechanism */ <add> /** A custom TypeConverter to use, overriding the default PropertyEditor mechanism. */ <ide> @Nullable <ide> private TypeConverter typeConverter; <ide> <del> /** String resolvers to apply e.g. to annotation attribute values */ <add> /** String resolvers to apply e.g. to annotation attribute values. */ <ide> private final List<StringValueResolver> embeddedValueResolvers = new LinkedList<>(); <ide> <del> /** BeanPostProcessors to apply in createBean */ <add> /** BeanPostProcessors to apply in createBean. */ <ide> private final List<BeanPostProcessor> beanPostProcessors = new ArrayList<>(); <ide> <del> /** Indicates whether any InstantiationAwareBeanPostProcessors have been registered */ <add> /** Indicates whether any InstantiationAwareBeanPostProcessors have been registered. */ <ide> private boolean hasInstantiationAwareBeanPostProcessors; <ide> <del> /** Indicates whether any DestructionAwareBeanPostProcessors have been registered */ <add> /** Indicates whether any DestructionAwareBeanPostProcessors have been registered. */ <ide> private boolean hasDestructionAwareBeanPostProcessors; <ide> <del> /** Map from scope identifier String to corresponding Scope */ <add> /** Map from scope identifier String to corresponding Scope. */ <ide> private final Map<String, Scope> scopes = new LinkedHashMap<>(8); <ide> <del> /** Security context used when running with a SecurityManager */ <add> /** Security context used when running with a SecurityManager. */ <ide> @Nullable <ide> private SecurityContextProvider securityContextProvider; <ide> <del> /** Map from bean name to merged RootBeanDefinition */ <add> /** Map from bean name to merged RootBeanDefinition. */ <ide> private final Map<String, RootBeanDefinition> mergedBeanDefinitions = new ConcurrentHashMap<>(256); <ide> <del> /** Names of beans that have already been created at least once */ <add> /** Names of beans that have already been created at least once. */ <ide> private final Set<String> alreadyCreated = Collections.newSetFromMap(new ConcurrentHashMap<>(256)); <ide> <del> /** Names of beans that are currently in creation */ <add> /** Names of beans that are currently in creation. */ <ide> private final ThreadLocal<Object> prototypesCurrentlyInCreation = <ide> new NamedThreadLocal<>("Prototype beans currently in creation"); <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> @SuppressWarnings("serial") <ide> public class AutowireCandidateQualifier extends BeanMetadataAttributeAccessor { <ide> <add> /** <add> * The name of the key used to store the value. <add> */ <ide> public static final String VALUE_KEY = "value"; <ide> <ide> private final String typeName; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java <ide> public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto <ide> } <ide> <ide> <del> /** Map from serialized id to factory instance */ <add> /** Map from serialized id to factory instance. */ <ide> private static final Map<String, Reference<DefaultListableBeanFactory>> serializableFactories = <ide> new ConcurrentHashMap<>(8); <ide> <del> /** Optional id for this factory, for serialization purposes */ <add> /** Optional id for this factory, for serialization purposes. */ <ide> @Nullable <ide> private String serializationId; <ide> <del> /** Whether to allow re-registration of a different definition with the same name */ <add> /** Whether to allow re-registration of a different definition with the same name. */ <ide> private boolean allowBeanDefinitionOverriding = true; <ide> <del> /** Whether to allow eager class loading even for lazy-init beans */ <add> /** Whether to allow eager class loading even for lazy-init beans. */ <ide> private boolean allowEagerClassLoading = true; <ide> <del> /** Optional OrderComparator for dependency Lists and arrays */ <add> /** Optional OrderComparator for dependency Lists and arrays. */ <ide> @Nullable <ide> private Comparator<Object> dependencyComparator; <ide> <del> /** Resolver to use for checking if a bean definition is an autowire candidate */ <add> /** Resolver to use for checking if a bean definition is an autowire candidate. */ <ide> private AutowireCandidateResolver autowireCandidateResolver = new SimpleAutowireCandidateResolver(); <ide> <del> /** Map from dependency type to corresponding autowired value */ <add> /** Map from dependency type to corresponding autowired value. */ <ide> private final Map<Class<?>, Object> resolvableDependencies = new ConcurrentHashMap<>(16); <ide> <del> /** Map of bean definition objects, keyed by bean name */ <add> /** Map of bean definition objects, keyed by bean name. */ <ide> private final Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>(256); <ide> <del> /** Map of singleton and non-singleton bean names, keyed by dependency type */ <add> /** Map of singleton and non-singleton bean names, keyed by dependency type. */ <ide> private final Map<Class<?>, String[]> allBeanNamesByType = new ConcurrentHashMap<>(64); <ide> <del> /** Map of singleton-only bean names, keyed by dependency type */ <add> /** Map of singleton-only bean names, keyed by dependency type. */ <ide> private final Map<Class<?>, String[]> singletonBeanNamesByType = new ConcurrentHashMap<>(64); <ide> <del> /** List of bean definition names, in registration order */ <add> /** List of bean definition names, in registration order. */ <ide> private volatile List<String> beanDefinitionNames = new ArrayList<>(256); <ide> <del> /** List of names of manually registered singletons, in registration order */ <add> /** List of names of manually registered singletons, in registration order. */ <ide> private volatile Set<String> manualSingletonNames = new LinkedHashSet<>(16); <ide> <del> /** Cached array of bean definition names in case of frozen configuration */ <add> /** Cached array of bean definition names in case of frozen configuration. */ <ide> @Nullable <ide> private volatile String[] frozenBeanDefinitionNames; <ide> <del> /** Whether bean definition metadata may be cached for all beans */ <add> /** Whether bean definition metadata may be cached for all beans. */ <ide> private volatile boolean configurationFrozen = false; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java <ide> */ <ide> public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements SingletonBeanRegistry { <ide> <del> /** Cache of singleton objects: bean name --> bean instance */ <add> /** Cache of singleton objects: bean name to bean instance. */ <ide> private final Map<String, Object> singletonObjects = new ConcurrentHashMap<>(256); <ide> <del> /** Cache of singleton factories: bean name --> ObjectFactory */ <add> /** Cache of singleton factories: bean name to ObjectFactory. */ <ide> private final Map<String, ObjectFactory<?>> singletonFactories = new HashMap<>(16); <ide> <del> /** Cache of early singleton objects: bean name --> bean instance */ <add> /** Cache of early singleton objects: bean name to bean instance. */ <ide> private final Map<String, Object> earlySingletonObjects = new HashMap<>(16); <ide> <del> /** Set of registered singletons, containing the bean names in registration order */ <add> /** Set of registered singletons, containing the bean names in registration order. */ <ide> private final Set<String> registeredSingletons = new LinkedHashSet<>(256); <ide> <del> /** Names of beans that are currently in creation */ <add> /** Names of beans that are currently in creation. */ <ide> private final Set<String> singletonsCurrentlyInCreation = <ide> Collections.newSetFromMap(new ConcurrentHashMap<>(16)); <ide> <del> /** Names of beans currently excluded from in creation checks */ <add> /** Names of beans currently excluded from in creation checks. */ <ide> private final Set<String> inCreationCheckExclusions = <ide> Collections.newSetFromMap(new ConcurrentHashMap<>(16)); <ide> <del> /** List of suppressed Exceptions, available for associating related causes */ <add> /** List of suppressed Exceptions, available for associating related causes. */ <ide> @Nullable <ide> private Set<Exception> suppressedExceptions; <ide> <del> /** Flag that indicates whether we're currently within destroySingletons */ <add> /** Flag that indicates whether we're currently within destroySingletons. */ <ide> private boolean singletonsCurrentlyInDestruction = false; <ide> <del> /** Disposable bean instances: bean name --> disposable instance */ <add> /** Disposable bean instances: bean name to disposable instance. */ <ide> private final Map<String, Object> disposableBeans = new LinkedHashMap<>(); <ide> <del> /** Map between containing bean names: bean name --> Set of bean names that the bean contains */ <add> /** Map between containing bean names: bean name to Set of bean names that the bean contains. */ <ide> private final Map<String, Set<String>> containedBeanMap = new ConcurrentHashMap<>(16); <ide> <del> /** Map between dependent bean names: bean name --> Set of dependent bean names */ <add> /** Map between dependent bean names: bean name to Set of dependent bean names. */ <ide> private final Map<String, Set<String>> dependentBeanMap = new ConcurrentHashMap<>(64); <ide> <del> /** Map between depending bean names: bean name --> Set of bean names for the bean's dependencies */ <add> /** Map between depending bean names: bean name to Set of bean names for the bean's dependencies. */ <ide> private final Map<String, Set<String>> dependenciesForBeanMap = new ConcurrentHashMap<>(64); <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/FactoryBeanRegistrySupport.java <ide> */ <ide> public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanRegistry { <ide> <del> /** Cache of singleton objects created by FactoryBeans: FactoryBean name --> object */ <add> /** Cache of singleton objects created by FactoryBeans: FactoryBean name to object. */ <ide> private final Map<String, Object> factoryBeanObjectCache = new ConcurrentHashMap<>(16); <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedArray.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> @SuppressWarnings("serial") <ide> public class ManagedArray extends ManagedList<Object> { <ide> <del> /** Resolved element type for runtime creation of the target array */ <add> /** Resolved element type for runtime creation of the target array. */ <ide> @Nullable <ide> volatile Class<?> resolvedElementType; <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Rob Harrop <ide> * @author Juergen Hoeller <ide> * @since 27.05.2003 <add> * @param <E> the element type <ide> */ <ide> @SuppressWarnings("serial") <ide> public class ManagedList<E> extends ArrayList<E> implements Mergeable, BeanMetadataElement { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedMap.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Juergen Hoeller <ide> * @author Rob Harrop <ide> * @since 27.05.2003 <add> * @param <K> the key type <add> * @param <V> the value type <ide> */ <ide> @SuppressWarnings("serial") <ide> public class ManagedMap<K, V> extends LinkedHashMap<K, V> implements Mergeable, BeanMetadataElement { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Juergen Hoeller <ide> * @author Rob Harrop <ide> * @since 21.01.2004 <add> * @param <E> the element type <ide> */ <ide> @SuppressWarnings("serial") <ide> public class ManagedSet<E> extends LinkedHashSet<E> implements Mergeable, BeanMetadataElement { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public void addOverride(MethodOverride override) { <ide> <ide> /** <ide> * Return all method overrides contained by this object. <del> * @return Set of MethodOverride objects <add> * @return a Set of MethodOverride objects <ide> * @see MethodOverride <ide> */ <ide> public Set<MethodOverride> getOverrides() { <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java <ide> public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader <ide> public static final String SEPARATOR = "."; <ide> <ide> /** <del> * Special key to distinguish {@code owner.(class)=com.myapp.MyClass}- <add> * Special key to distinguish {@code owner.(class)=com.myapp.MyClass}. <ide> */ <ide> public static final String CLASS_KEY = "(class)"; <ide> <ide> public int registerBeanDefinitions(ResourceBundle rb, @Nullable String prefix) t <ide> <ide> <ide> /** <del> * Register bean definitions contained in a Map, <del> * using all property keys (i.e. not filtering by prefix). <del> * @param map Map: name -> property (String or Object). Property values <del> * will be strings if coming from a Properties file etc. Property names <add> * Register bean definitions contained in a Map, using all property keys (i.e. not <add> * filtering by prefix). <add> * @param map a map of {@code name} to {@code property} (String or Object). Property <add> * values will be strings if coming from a Properties file etc. Property names <ide> * (keys) <b>must</b> be Strings. Class keys must be Strings. <ide> * @return the number of bean definitions found <ide> * @throws BeansException in case of loading or parsing errors <ide> public int registerBeanDefinitions(Map<?, ?> map) throws BeansException { <ide> /** <ide> * Register bean definitions contained in a Map. <ide> * Ignore ineligible properties. <del> * @param map Map name -> property (String or Object). Property values <del> * will be strings if coming from a Properties file etc. Property names <add> * @param map a map of {@code name} to {@code property} (String or Object). Property <add> * values will be strings if coming from a Properties file etc. Property names <ide> * (keys) <b>must</b> be Strings. Class keys must be Strings. <ide> * @param prefix a filter within the keys in the map: e.g. 'beans.' <ide> * (can be empty or {@code null}) <ide> public int registerBeanDefinitions(Map<?, ?> map, @Nullable String prefix) throw <ide> /** <ide> * Register bean definitions contained in a Map. <ide> * Ignore ineligible properties. <del> * @param map Map name -> property (String or Object). Property values <del> * will be strings if coming from a Properties file etc. Property names <del> * (keys) <b>must</b> be strings. Class keys must be Strings. <add> * @param map a map of {@code name} to {@code property} (String or Object). Property <add> * values will be strings if coming from a Properties file etc. Property names <add> * (keys) <b>must</b> be Strings. Class keys must be Strings. <ide> * @param prefix a filter within the keys in the map: e.g. 'beans.' <ide> * (can be empty or {@code null}) <ide> * @param resourceDescription description of the resource that the <ide> public int registerBeanDefinitions(Map<?, ?> map, @Nullable String prefix, Strin <ide> <ide> /** <ide> * Get all property values, given a prefix (which will be stripped) <del> * and add the bean they define to the factory with the given name <add> * and add the bean they define to the factory with the given name. <ide> * @param beanName name of the bean to define <del> * @param map Map containing string pairs <add> * @param map a Map containing string pairs <ide> * @param prefix prefix of each entry, which will be stripped <ide> * @param resourceDescription description of the resource that the <ide> * Map came from (for logging purposes) <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class RootBeanDefinition extends AbstractBeanDefinition { <ide> @Nullable <ide> volatile ResolvableType targetType; <ide> <del> /** Package-visible field for caching the determined Class of a given bean definition */ <add> /** Package-visible field for caching the determined Class of a given bean definition. */ <ide> @Nullable <ide> volatile Class<?> resolvedTargetType; <ide> <del> /** Package-visible field for caching the return type of a generically typed factory method */ <add> /** Package-visible field for caching the return type of a generically typed factory method. */ <ide> @Nullable <ide> volatile ResolvableType factoryMethodReturnType; <ide> <del> /** Common lock for the four constructor fields below */ <add> /** Common lock for the four constructor fields below. */ <ide> final Object constructorArgumentLock = new Object(); <ide> <del> /** Package-visible field for caching the resolved constructor or factory method */ <add> /** Package-visible field for caching the resolved constructor or factory method. */ <ide> @Nullable <ide> Executable resolvedConstructorOrFactoryMethod; <ide> <del> /** Package-visible field that marks the constructor arguments as resolved */ <add> /** Package-visible field that marks the constructor arguments as resolved. */ <ide> boolean constructorArgumentsResolved = false; <ide> <del> /** Package-visible field for caching fully resolved constructor arguments */ <add> /** Package-visible field for caching fully resolved constructor arguments. */ <ide> @Nullable <ide> Object[] resolvedConstructorArguments; <ide> <del> /** Package-visible field for caching partly prepared constructor arguments */ <add> /** Package-visible field for caching partly prepared constructor arguments. */ <ide> @Nullable <ide> Object[] preparedConstructorArguments; <ide> <del> /** Common lock for the two post-processing fields below */ <add> /** Common lock for the two post-processing fields below. */ <ide> final Object postProcessingLock = new Object(); <ide> <del> /** Package-visible field that indicates MergedBeanDefinitionPostProcessor having been applied */ <add> /** Package-visible field that indicates MergedBeanDefinitionPostProcessor having been applied. */ <ide> boolean postProcessed = false; <ide> <del> /** Package-visible field that indicates a before-instantiation post-processor having kicked in */ <add> /** Package-visible field that indicates a before-instantiation post-processor having kicked in. */ <ide> @Nullable <ide> volatile Boolean beforeInstantiationResolved; <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class SimpleBeanDefinitionRegistry extends SimpleAliasRegistry implements BeanDefinitionRegistry { <ide> <del> /** Map of bean definition objects, keyed by bean name */ <add> /** Map of bean definition objects, keyed by bean name. */ <ide> private final Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>(64); <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java <ide> */ <ide> public class StaticListableBeanFactory implements ListableBeanFactory { <ide> <del> /** Map from bean name to bean instance */ <add> /** Map from bean name to bean instance. */ <ide> private final Map<String, Object> beans; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.java <ide> */ <ide> public class BeanConfigurerSupport implements BeanFactoryAware, InitializingBean, DisposableBean { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> @Nullable <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/AbstractBeanDefinitionParser.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class AbstractBeanDefinitionParser implements BeanDefinitionParser { <ide> <del> /** Constant for the "id" attribute */ <add> /** Constant for the "id" attribute. */ <ide> public static final String ID_ATTRIBUTE = "id"; <ide> <del> /** Constant for the "name" attribute */ <add> /** Constant for the "name" attribute. */ <ide> public static final String NAME_ATTRIBUTE = "name"; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public void initDefaults(Element root, @Nullable BeanDefinitionParserDelegate pa <ide> /** <ide> * Populate the given DocumentDefaultsDefinition instance with the default lazy-init, <ide> * autowire, dependency check settings, init-method, destroy-method and merge settings. <del> * Support nested 'beans' element use cases by falling back to <literal>parentDefaults</literal> <add> * Support nested 'beans' element use cases by falling back to {@code parentDefaults} <ide> * in case the defaults are not explicitly set locally. <ide> * @param defaults the defaults to populate <ide> * @param parentDefaults the parent BeanDefinitionParserDelegate (if any) defaults to fall back to <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java <ide> public class DefaultNamespaceHandlerResolver implements NamespaceHandlerResolver <ide> public static final String DEFAULT_HANDLER_MAPPINGS_LOCATION = "META-INF/spring.handlers"; <ide> <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <del> /** ClassLoader to use for NamespaceHandler classes */ <add> /** ClassLoader to use for NamespaceHandler classes. */ <ide> @Nullable <ide> private final ClassLoader classLoader; <ide> <del> /** Resource location to search for */ <add> /** Resource location to search for. */ <ide> private final String handlerMappingsLocation; <ide> <del> /** Stores the mappings from namespace URI to NamespaceHandler class name / instance */ <add> /** Stores the mappings from namespace URI to NamespaceHandler class name / instance. */ <ide> @Nullable <ide> private volatile Map<String, Object> handlerMappings; <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/DelegatingEntityResolver.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class DelegatingEntityResolver implements EntityResolver { <ide> <del> /** Suffix for DTD files */ <add> /** Suffix for DTD files. */ <ide> public static final String DTD_SUFFIX = ".dtd"; <ide> <del> /** Suffix for schema definition files */ <add> /** Suffix for schema definition files. */ <ide> public static final String XSD_SUFFIX = ".xsd"; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class PluggableSchemaResolver implements EntityResolver { <ide> <ide> private final String schemaMappingsLocation; <ide> <del> /** Stores the mapping of schema URL -> local schema path */ <add> /** Stores the mapping of schema URL -> local schema path. */ <ide> @Nullable <ide> private volatile Map<String, String> schemaMappings; <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { <ide> public static final int VALIDATION_XSD = XmlValidationModeDetector.VALIDATION_XSD; <ide> <ide> <del> /** Constants instance for this class */ <add> /** Constants instance for this class. */ <ide> private static final Constants constants = new Constants(XmlBeanDefinitionReader.class); <ide> <ide> private int validationMode = VALIDATION_AUTO; <ide><path>spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanFactory.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class XmlBeanFactory extends DefaultListableBeanFactory { <ide> /** <ide> * Create a new XmlBeanFactory with the given resource, <ide> * which must be parsable using DOM. <del> * @param resource XML resource to load bean definitions from <add> * @param resource the XML resource to load bean definitions from <ide> * @throws BeansException in case of loading or parsing errors <ide> */ <ide> public XmlBeanFactory(Resource resource) throws BeansException { <ide> public XmlBeanFactory(Resource resource) throws BeansException { <ide> /** <ide> * Create a new XmlBeanFactory with the given input stream, <ide> * which must be parsable using DOM. <del> * @param resource XML resource to load bean definitions from <add> * @param resource the XML resource to load bean definitions from <ide> * @param parentBeanFactory parent bean factory <ide> * @throws BeansException in case of loading or parsing errors <ide> */ <ide><path>spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomBooleanEditor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class CustomBooleanEditor extends PropertyEditorSupport { <ide> <add> /** <add> * Value of {@code "true"}. <add> */ <ide> public static final String VALUE_TRUE = "true"; <add> <add> /** <add> * Value of {@code "false"}. <add> */ <ide> public static final String VALUE_FALSE = "false"; <ide> <add> /** <add> * Value of {@code "on"}. <add> */ <ide> public static final String VALUE_ON = "on"; <add> <add> /** <add> * Value of {@code "off"}. <add> */ <ide> public static final String VALUE_OFF = "off"; <ide> <add> /** <add> * Value of {@code "yes"}. <add> */ <ide> public static final String VALUE_YES = "yes"; <add> <add> /** <add> * Value of {@code "no"}. <add> */ <ide> public static final String VALUE_NO = "no"; <ide> <add> /** <add> * Value of {@code "1"}. <add> */ <ide> public static final String VALUE_1 = "1"; <add> <add> /** <add> * Value of {@code "0"}. <add> */ <ide> public static final String VALUE_0 = "0"; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class CustomDateEditor extends PropertyEditorSupport { <ide> * <p>The "allowEmpty" parameter states if an empty String should <ide> * be allowed for parsing, i.e. get interpreted as null value. <ide> * Otherwise, an IllegalArgumentException gets thrown in that case. <del> * @param dateFormat DateFormat to use for parsing and rendering <add> * @param dateFormat the DateFormat to use for parsing and rendering <ide> * @param allowEmpty if empty strings should be allowed <ide> */ <ide> public CustomDateEditor(DateFormat dateFormat, boolean allowEmpty) { <ide> public CustomDateEditor(DateFormat dateFormat, boolean allowEmpty) { <ide> * with an "exactDateLength" specified, prepended zeros in the day or month <ide> * part may still allow for a shorter year part, so consider this as just <ide> * one more assertion that gets you closer to the intended date format. <del> * @param dateFormat DateFormat to use for parsing and rendering <add> * @param dateFormat the DateFormat to use for parsing and rendering <ide> * @param allowEmpty if empty strings should be allowed <ide> * @param exactDateLength the exact expected length of the date String <ide> */ <ide><path>spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomNumberEditor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class CustomNumberEditor extends PropertyEditorSupport { <ide> * <p>The "allowEmpty" parameter states if an empty String should <ide> * be allowed for parsing, i.e. get interpreted as {@code null} value. <ide> * Else, an IllegalArgumentException gets thrown in that case. <del> * @param numberClass Number subclass to generate <add> * @param numberClass the Number subclass to generate <ide> * @param allowEmpty if empty strings should be allowed <ide> * @throws IllegalArgumentException if an invalid numberClass has been specified <ide> * @see org.springframework.util.NumberUtils#parseNumber(String, Class) <ide> public CustomNumberEditor(Class<? extends Number> numberClass, boolean allowEmpt <ide> * <p>The allowEmpty parameter states if an empty String should <ide> * be allowed for parsing, i.e. get interpreted as {@code null} value. <ide> * Else, an IllegalArgumentException gets thrown in that case. <del> * @param numberClass Number subclass to generate <del> * @param numberFormat NumberFormat to use for parsing and rendering <add> * @param numberClass the Number subclass to generate <add> * @param numberFormat the NumberFormat to use for parsing and rendering <ide> * @param allowEmpty if empty strings should be allowed <ide> * @throws IllegalArgumentException if an invalid numberClass has been specified <ide> * @see org.springframework.util.NumberUtils#parseNumber(String, Class, java.text.NumberFormat) <ide><path>spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class StringArrayPropertyEditor extends PropertyEditorSupport { <ide> <ide> /** <del> * Default separator for splitting a String: a comma (",") <add> * Default separator for splitting a String: a comma (","). <ide> */ <ide> public static final String DEFAULT_SEPARATOR = ","; <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Juergen Hoeller <ide> * @since 19.05.2003 <add> * @param <E> the element type <ide> * @see #getPageList() <ide> * @see org.springframework.beans.support.MutableSortDefinition <ide> */ <ide> @SuppressWarnings("serial") <ide> public class PagedListHolder<E> implements Serializable { <ide> <add> /** <add> * The default page size. <add> */ <ide> public static final int DEFAULT_PAGE_SIZE = 10; <ide> <add> /** <add> * The default maximum number of page links. <add> */ <ide> public static final int DEFAULT_MAX_LINKED_PAGES = 10; <ide> <ide> <ide><path>spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java <ide> * @author Juergen Hoeller <ide> * @author Jean-Pierre Pawlak <ide> * @since 19.05.2003 <add> * @param <T> the type of objects that may be compared by this comparator <ide> * @see org.springframework.beans.BeanWrapper <ide> */ <ide> public class PropertyComparator<T> implements Comparator<T> { <ide><path>spring-context-indexer/src/main/java/org/springframework/context/index/MetadataCollector.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> class MetadataCollector { <ide> <ide> /** <ide> * Create a new {@code MetadataProcessor} instance. <del> * @param processingEnvironment The processing environment of the build <del> * @param previousMetadata Any previous metadata or {@code null} <add> * @param processingEnvironment the processing environment of the build <add> * @param previousMetadata any previous metadata or {@code null} <ide> */ <ide> public MetadataCollector(ProcessingEnvironment processingEnvironment, <ide> CandidateComponentsMetadata previousMetadata) { <ide><path>spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public void setCacheName(String cacheName) { <ide> } <ide> <ide> /** <add> * Set the time to live. <ide> * @see #setTimeToLiveSeconds(long) <ide> */ <ide> public void setTimeToLive(int timeToLive) { <ide> setTimeToLiveSeconds(timeToLive); <ide> } <ide> <ide> /** <add> * Set the time to idle. <ide> * @see #setTimeToIdleSeconds(long) <ide> */ <ide> public void setTimeToIdle(int timeToIdle) { <ide> setTimeToIdleSeconds(timeToIdle); <ide> } <ide> <ide> /** <add> * Set the disk spool buffer size (in MB). <ide> * @see #setDiskSpoolBufferSizeMB(int) <ide> */ <ide> public void setDiskSpoolBufferSize(int diskSpoolBufferSize) { <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractCacheInterceptor.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <add> * @param <O> the operation type <add> * @param <A> the annotation type <ide> */ <ide> @SuppressWarnings("serial") <ide> abstract class AbstractCacheInterceptor<O extends AbstractJCacheOperation<A>, A extends Annotation> <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractJCacheKeyOperation.java <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <add> * @param <A> the annotation type <ide> */ <ide> abstract class AbstractJCacheKeyOperation<A extends Annotation> extends AbstractJCacheOperation<A> { <ide> <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractJCacheOperation.java <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <add> * @param <A> the annotation type <ide> */ <ide> abstract class AbstractJCacheOperation<A extends Annotation> implements JCacheOperation<A> { <ide> <ide> private static List<CacheParameterDetail> initializeAllParameterDetails(Method m <ide> } <ide> <ide> <add> /** <add> * Details for a single cache parameter. <add> */ <ide> protected static class CacheParameterDetail { <ide> <ide> private final Class<?> rawType; <ide> public CacheInvocationParameter toCacheInvocationParameter(Object value) { <ide> } <ide> <ide> <add> /** <add> * A single cache invocation parameter. <add> */ <ide> protected static class CacheInvocationParameterImpl implements CacheInvocationParameter { <ide> <ide> private final CacheParameterDetail detail; <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractKeyCacheInterceptor.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <add> * @param <O> the operation type <add> * @param <A> the annotation type <ide> */ <ide> @SuppressWarnings("serial") <ide> abstract class AbstractKeyCacheInterceptor<O extends AbstractJCacheKeyOperation<A>, A extends Annotation> <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultCacheInvocationContext.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <add> * @param <A> the annotation type <ide> */ <ide> class DefaultCacheInvocationContext<A extends Annotation> <ide> implements CacheInvocationContext<A>, CacheOperationInvocationContext<JCacheOperation<A>> { <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultCacheKeyInvocationContext.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <add> * @param <A> the annotation type <ide> */ <ide> class DefaultCacheKeyInvocationContext<A extends Annotation> <ide> extends DefaultCacheInvocationContext<A> implements CacheKeyInvocationContext<A> { <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultCacheMethodDetails.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <add> * @param <A> the annotation type <ide> */ <ide> class DefaultCacheMethodDetails<A extends Annotation> implements CacheMethodDetails<A> { <ide> <ide><path>spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/SimpleExceptionCacheResolver.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> /** <ide> * A simple {@link CacheResolver} that resolves the exception cache <ide> * based on a configurable {@link CacheManager} and the name of the <del> * cache: {@link CacheResultOperation#getExceptionCacheName()} <add> * cache: {@link CacheResultOperation#getExceptionCacheName()}. <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <ide><path>spring-context-support/src/main/java/org/springframework/mail/MailSendException.java <ide> public MailSendException(String msg, @Nullable Throwable cause) { <ide> * to the invoked send method. <ide> * @param msg the detail message <ide> * @param cause the root cause from the mail API in use <del> * @param failedMessages Map of failed messages as keys and thrown <add> * @param failedMessages a Map of failed messages as keys and thrown <ide> * exceptions as values <ide> */ <ide> public MailSendException(@Nullable String msg, @Nullable Throwable cause, Map<Object, Exception> failedMessages) { <ide> public MailSendException(@Nullable String msg, @Nullable Throwable cause, Map<Ob <ide> * messages that failed as keys, and the thrown exceptions as values. <ide> * <p>The messages should be the same that were originally passed <ide> * to the invoked send method. <del> * @param failedMessages Map of failed messages as keys and thrown <add> * @param failedMessages a Map of failed messages as keys and thrown <ide> * exceptions as values <ide> */ <ide> public MailSendException(Map<Object, Exception> failedMessages) { <ide><path>spring-context-support/src/main/java/org/springframework/mail/javamail/ConfigurableMimeFileTypeMap.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public void setMappingLocation(Resource mappingLocation) { <ide> /** <ide> * Specify additional MIME type mappings as lines that follow the <ide> * {@code mime.types} file format, as specified by the <del> * Java Activation Framework, for example:<br> <add> * Java Activation Framework. For example:<br> <ide> * {@code text/html html htm HTML HTM} <ide> */ <ide> public void setMappings(String... mappings) { <ide> protected final FileTypeMap getFileTypeMap() { <ide> * passing in an InputStream from the mapping resource (if any) and registering <ide> * the mapping lines programmatically. <ide> * @param mappingLocation a {@code mime.types} mapping resource (can be {@code null}) <del> * @param mappings MIME type mapping lines (can be {@code null}) <add> * @param mappings an array of MIME type mapping lines (can be {@code null}) <ide> * @return the compiled FileTypeMap <ide> * @throws IOException if resource access failed <ide> * @see javax.activation.MimetypesFileTypeMap#MimetypesFileTypeMap(java.io.InputStream) <ide><path>spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSenderImpl.java <ide> */ <ide> public class JavaMailSenderImpl implements JavaMailSender { <ide> <del> /** The default protocol: 'smtp' */ <add> /** The default protocol: 'smtp'. */ <ide> public static final String DEFAULT_PROTOCOL = "smtp"; <ide> <del> /** The default port: -1 */ <add> /** The default port: -1. */ <ide> public static final int DEFAULT_PORT = -1; <ide> <ide> private static final String HEADER_MESSAGE_ID = "Message-ID"; <ide> public void testConnection() throws MessagingException { <ide> <ide> /** <ide> * Actually send the given array of MimeMessages via JavaMail. <del> * @param mimeMessages MimeMessage objects to send <add> * @param mimeMessages the MimeMessage objects to send <ide> * @param originalMessages corresponding original message objects <ide> * that the MimeMessages have been created from (with same array <ide> * length and indices as the "mimeMessages" array), if any <ide><path>spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class MimeMessageHelper { <ide> * <p>The character encoding for the message will be taken from <ide> * the passed-in MimeMessage object, if carried there. Else, <ide> * JavaMail's default encoding will be used. <del> * @param mimeMessage MimeMessage to work on <add> * @param mimeMessage the mime message to work on <ide> * @see #MimeMessageHelper(javax.mail.internet.MimeMessage, boolean) <ide> * @see #getDefaultEncoding(javax.mail.internet.MimeMessage) <ide> * @see JavaMailSenderImpl#setDefaultEncoding <ide> public MimeMessageHelper(MimeMessage mimeMessage) { <ide> * Create a new MimeMessageHelper for the given MimeMessage, <ide> * assuming a simple text message (no multipart content, <ide> * i.e. no alternative texts and no inline elements or attachments). <del> * @param mimeMessage MimeMessage to work on <add> * @param mimeMessage the mime message to work on <ide> * @param encoding the character encoding to use for the message <ide> * @see #MimeMessageHelper(javax.mail.internet.MimeMessage, boolean) <ide> */ <ide> public MimeMessageHelper(MimeMessage mimeMessage, @Nullable String encoding) { <ide> * <p>The character encoding for the message will be taken from <ide> * the passed-in MimeMessage object, if carried there. Else, <ide> * JavaMail's default encoding will be used. <del> * @param mimeMessage MimeMessage to work on <add> * @param mimeMessage the mime message to work on <ide> * @param multipart whether to create a multipart message that <ide> * supports alternative texts, inline elements and attachments <ide> * (corresponds to MULTIPART_MODE_MIXED_RELATED) <ide> public MimeMessageHelper(MimeMessage mimeMessage, boolean multipart) throws Mess <ide> * <p>Consider using the MimeMessageHelper constructor that <ide> * takes a multipartMode argument to choose a specific multipart <ide> * mode other than MULTIPART_MODE_MIXED_RELATED. <del> * @param mimeMessage MimeMessage to work on <add> * @param mimeMessage the mime message to work on <ide> * @param multipart whether to create a multipart message that <ide> * supports alternative texts, inline elements and attachments <ide> * (corresponds to MULTIPART_MODE_MIXED_RELATED) <ide> public MimeMessageHelper(MimeMessage mimeMessage, boolean multipart, @Nullable S <ide> * <p>The character encoding for the message will be taken from <ide> * the passed-in MimeMessage object, if carried there. Else, <ide> * JavaMail's default encoding will be used. <del> * @param mimeMessage MimeMessage to work on <add> * @param mimeMessage the mime message to work on <ide> * @param multipartMode which kind of multipart message to create <ide> * (MIXED, RELATED, MIXED_RELATED, or NO) <ide> * @throws MessagingException if multipart creation failed <ide> public MimeMessageHelper(MimeMessage mimeMessage, int multipartMode) throws Mess <ide> * Create a new MimeMessageHelper for the given MimeMessage, <ide> * in multipart mode (supporting alternative texts, inline <ide> * elements and attachments) if requested. <del> * @param mimeMessage MimeMessage to work on <add> * @param mimeMessage the mime message to work on <ide> * @param multipartMode which kind of multipart message to create <ide> * (MIXED, RELATED, MIXED_RELATED, or NO) <ide> * @param encoding the character encoding to use for the message <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/CronTriggerFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class CronTriggerFactoryBean implements FactoryBean<CronTrigger>, BeanNameAware, InitializingBean { <ide> <del> /** Constants for the CronTrigger class */ <add> /** Constants for the CronTrigger class. */ <ide> private static final Constants constants = new Constants(CronTrigger.class); <ide> <ide> <ide> public JobDataMap getJobDataMap() { <ide> * Register objects in the JobDataMap via a given Map. <ide> * <p>These objects will be available to this Trigger only, <ide> * in contrast to objects in the JobDetail's data map. <del> * @param jobDataAsMap Map with String keys and any objects as values <add> * @param jobDataAsMap a Map with String keys and any objects as values <ide> * (for example Spring-managed beans) <ide> */ <ide> public void setJobDataAsMap(Map<String, ?> jobDataAsMap) { <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public JobDataMap getJobDataMap() { <ide> * <p>Note: When using persistent Jobs whose JobDetail will be kept in the <ide> * database, do not put Spring-managed beans or an ApplicationContext <ide> * reference into the JobDataMap but rather into the SchedulerContext. <del> * @param jobDataAsMap Map with String keys and any objects as values <add> * @param jobDataAsMap a Map with String keys and any objects as values <ide> * (for example Spring-managed beans) <ide> * @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setSchedulerContextAsMap <ide> */ <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java <ide> */ <ide> public class LocalTaskExecutorThreadPool implements ThreadPool { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> @Nullable <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public void setJobDetails(JobDetail... jobDetails) { <ide> /** <ide> * Register a list of Quartz Calendar objects with the Scheduler <ide> * that this FactoryBean creates, to be referenced by Triggers. <del> * @param calendars Map with calendar names as keys as Calendar <add> * @param calendars a Map with calendar names as keys as Calendar <ide> * objects as values <ide> * @see org.quartz.Calendar <ide> */ <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java <ide> public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBean<Scheduler>, <ide> BeanNameAware, ApplicationContextAware, InitializingBean, DisposableBean, SmartLifecycle { <ide> <add> /** <add> * The thread count property. <add> */ <ide> public static final String PROP_THREAD_COUNT = "org.quartz.threadPool.threadCount"; <ide> <add> /** <add> * The default thread count. <add> */ <ide> public static final int DEFAULT_THREAD_COUNT = 10; <ide> <ide> <ide> public void setNonTransactionalDataSource(DataSource nonTransactionalDataSource) <ide> * <p>Note: When using persistent Jobs whose JobDetail will be kept in the <ide> * database, do not put Spring-managed beans or an ApplicationContext <ide> * reference into the JobDataMap but rather into the SchedulerContext. <del> * @param schedulerContextAsMap Map with String keys and any objects as <add> * @param schedulerContextAsMap a Map with String keys and any objects as <ide> * values (for example Spring-managed beans) <ide> * @see JobDetailFactoryBean#setJobDataAsMap <ide> */ <ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleTriggerFactoryBean.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class SimpleTriggerFactoryBean implements FactoryBean<SimpleTrigger>, BeanNameAware, InitializingBean { <ide> <del> /** Constants for the SimpleTrigger class */ <add> /** Constants for the SimpleTrigger class. */ <ide> private static final Constants constants = new Constants(SimpleTrigger.class); <ide> <ide> <ide> public JobDataMap getJobDataMap() { <ide> * Register objects in the JobDataMap via a given Map. <ide> * <p>These objects will be available to this Trigger only, <ide> * in contrast to objects in the JobDetail's data map. <del> * @param jobDataAsMap Map with String keys and any objects as values <add> * @param jobDataAsMap a Map with String keys and any objects as values <ide> * (for example Spring-managed beans) <ide> */ <ide> public void setJobDataAsMap(Map<String, ?> jobDataAsMap) { <ide><path>spring-context/src/main/java/org/springframework/cache/annotation/AnnotationCacheOperationSource.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> protected Collection<CacheOperation> findCacheOperations(final Method method) { <ide> /** <ide> * Determine the cache operation(s) for the given {@link CacheOperationProvider}. <ide> * <p>This implementation delegates to configured <del> * {@link CacheAnnotationParser}s for parsing known annotations into <add> * {@link CacheAnnotationParser CacheAnnotationParsers} for parsing known annotations into <ide> * Spring's metadata attribute class. <ide> * <p>Can be overridden to support custom annotations that carry <ide> * caching metadata. <ide><path>spring-context/src/main/java/org/springframework/cache/annotation/CacheAnnotationParser.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface CacheAnnotationParser { <ide> * metadata attribute class. Returns {@code null} if the class <ide> * is not cacheable. <ide> * @param type the annotated class <del> * @return CacheOperation the configured caching operation, <add> * @return the configured caching operation, <ide> * or {@code null} if none was found <ide> * @see AnnotationCacheOperationSource#findCacheOperations(Class) <ide> */ <ide> public interface CacheAnnotationParser { <ide> * metadata attribute class. Returns {@code null} if the method <ide> * is not cacheable. <ide> * @param method the annotated method <del> * @return CacheOperation the configured caching operation, <add> * @return the configured caching operation, <ide> * or {@code null} if none was found <ide> * @see AnnotationCacheOperationSource#findCacheOperations(Method) <ide> */ <ide><path>spring-context/src/main/java/org/springframework/cache/annotation/EnableCaching.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * configuration: <ide> * <ide> * <pre class="code"> <del> * {@code <del> * <beans> <add> * &lt;beans&gt; <ide> * <del> * <cache:annotation-driven/> <add> * &lt;cache:annotation-driven/&gt; <ide> * <del> * <bean id="myService" class="com.foo.MyService"/> <add> * &lt;bean id="myService" class="com.foo.MyService"/&gt; <ide> * <del> * <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> <del> * <property name="caches"> <del> * <set> <del> * <bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"> <del> * <property name="name" value="default"/> <del> * </bean> <del> * </set> <del> * </property> <del> * </bean> <add> * &lt;bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"&gt; <add> * &lt;property name="caches"&gt; <add> * &lt;set&gt; <add> * &lt;bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"&gt; <add> * &lt;property name="name" value="default"/&gt; <add> * &lt;/bean&gt; <add> * &lt;/set&gt; <add> * &lt;/property&gt; <add> * &lt;/bean&gt; <ide> * <del> * </beans> <del> * }</pre> <add> * &lt;/beans&gt; <add> * </pre> <ide> * <ide> * In both of the scenarios above, {@code @EnableCaching} and {@code <ide> * <cache:annotation-driven/>} are responsible for registering the necessary Spring <ide><path>spring-context/src/main/java/org/springframework/cache/config/AnnotationDrivenCacheBeanDefinitionParser.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> private static void registerCacheAdvisor(Element element, ParserContext parserCo <ide> } <ide> <ide> /** <del> * Registers a <add> * Registers a cache aspect. <ide> * <pre class="code"> <del> * <bean id="cacheAspect" class="org.springframework.cache.aspectj.AnnotationCacheAspect" factory-method="aspectOf"> <del> * <property name="cacheManager" ref="cacheManager"/> <del> * <property name="keyGenerator" ref="keyGenerator"/> <del> * </bean> <add> * &lt;bean id="cacheAspect" class="org.springframework.cache.aspectj.AnnotationCacheAspect" factory-method="aspectOf"&gt; <add> * &lt;property name="cacheManager" ref="cacheManager"/&gt; <add> * &lt;property name="keyGenerator" ref="keyGenerator"/&gt; <add> * &lt;/bean&gt; <ide> * </pre> <ide> */ <ide> private static void registerCacheAspect(Element element, ParserContext parserContext) { <ide><path>spring-context/src/main/java/org/springframework/cache/config/CacheManagementConfigUtils.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class CacheManagementConfigUtils { <ide> <add> /** <add> * The name of the cache advisor bean. <add> */ <ide> public static final String CACHE_ADVISOR_BEAN_NAME = <ide> "org.springframework.cache.config.internalCacheAdvisor"; <ide> <add> /** <add> * The name of the cache aspect bean. <add> */ <ide> public static final String CACHE_ASPECT_BEAN_NAME = <ide> "org.springframework.cache.config.internalCacheAspect"; <ide> <add> /** <add> * The name of the JCache advisor bean. <add> */ <ide> public static final String JCACHE_ADVISOR_BEAN_NAME = <ide> "org.springframework.cache.config.internalJCacheAdvisor"; <ide> <add> /** <add> * The name of the JCache advisor bean. <add> */ <ide> public static final String JCACHE_ASPECT_BEAN_NAME = <ide> "org.springframework.cache.config.internalJCacheAspect"; <ide> <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java <ide> public CacheOperationMetadata(CacheOperation operation, Method method, Class<?> <ide> } <ide> <ide> <add> /** <add> * A {@link CacheOperationInvocationContext} context for a {@link CacheOperation}. <add> */ <ide> protected class CacheOperationContext implements CacheOperationInvocationContext<CacheOperation> { <ide> <ide> private final CacheOperationMetadata metadata; <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CacheEvictOperation.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class CacheEvictOperation extends CacheOperation { <ide> <ide> <ide> /** <add> * Create a new {@link CacheEvictOperation} instance from the given builder. <ide> * @since 4.3 <ide> */ <ide> public CacheEvictOperation(CacheEvictOperation.Builder b) { <ide> public boolean isBeforeInvocation() { <ide> <ide> <ide> /** <add> * A builder that can be used to create a {@link CacheEvictOperation}. <ide> * @since 4.3 <ide> */ <ide> public static class Builder extends CacheOperation.Builder { <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperation.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class CacheOperation implements BasicOperation { <ide> <ide> <ide> /** <add> * Create a new {@link CacheOperation} instance from the given builder. <ide> * @since 4.3 <ide> */ <ide> protected CacheOperation(Builder b) { <ide> public final String toString() { <ide> <ide> <ide> /** <add> * Base class for builders that can be used to create a {@link CacheOperation}. <ide> * @since 4.3 <ide> */ <ide> public abstract static class Builder { <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationInvocationContext.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <add> * @param <O> the operation type <ide> */ <ide> public interface CacheOperationInvocationContext<O extends BasicOperation> { <ide> <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CachePutOperation.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class CachePutOperation extends CacheOperation { <ide> <ide> <ide> /** <add> * Create a new {@link CachePutOperation} instance from the given builder. <ide> * @since 4.3 <ide> */ <ide> public CachePutOperation(CachePutOperation.Builder b) { <ide> public String getUnless() { <ide> <ide> <ide> /** <add> * A builder that can be used to create a {@link CachePutOperation}. <ide> * @since 4.3 <ide> */ <ide> public static class Builder extends CacheOperation.Builder { <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/CacheableOperation.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class CacheableOperation extends CacheOperation { <ide> <ide> <ide> /** <add> * Create a new {@link CacheableOperation} instance from the given builder. <ide> * @since 4.3 <ide> */ <ide> public CacheableOperation(CacheableOperation.Builder b) { <ide> public boolean isSync() { <ide> <ide> <ide> /** <add> * A builder that can be used to create a {@link CacheableOperation}. <ide> * @since 4.3 <ide> */ <ide> public static class Builder extends CacheOperation.Builder { <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/NameMatchCacheOperationSource.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class NameMatchCacheOperationSource implements CacheOperationSource, Seri <ide> protected static final Log logger = LogFactory.getLog(NameMatchCacheOperationSource.class); <ide> <ide> <del> /** Keys are method names; values are TransactionAttributes */ <add> /** Keys are method names; values are TransactionAttributes. */ <ide> private Map<String, Collection<CacheOperation>> nameMap = new LinkedHashMap<>(); <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/SimpleCacheResolver.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> /** <ide> * A simple {@link CacheResolver} that resolves the {@link Cache} instance(s) <ide> * based on a configurable {@link CacheManager} and the name of the <del> * cache(s) as provided by {@link BasicOperation#getCacheNames() getCacheNames()} <add> * cache(s) as provided by {@link BasicOperation#getCacheNames() getCacheNames()}. <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/SimpleKey.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> @SuppressWarnings("serial") <ide> public class SimpleKey implements Serializable { <ide> <add> /** <add> * An empty key. <add> */ <ide> public static final SimpleKey EMPTY = new SimpleKey(); <ide> <ide> private final Object[] params; <ide><path>spring-context/src/main/java/org/springframework/cache/support/NoOpCache.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class NoOpCache implements Cache { <ide> <ide> <ide> /** <del> * Create a {@link NoOpCache} instance with the specified name <add> * Create a {@link NoOpCache} instance with the specified name. <ide> * @param name the name of the cache <ide> */ <ide> public NoOpCache(String name) { <ide><path>spring-context/src/main/java/org/springframework/context/ApplicationContextInitializer.java <ide> /* <del> * Copyright 2002-2011 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Chris Beams <ide> * @since 3.1 <add> * @param <C> the application context type <ide> * @see org.springframework.web.context.ContextLoader#customizeContext <ide> * @see org.springframework.web.context.ContextLoader#CONTEXT_INITIALIZER_CLASSES_PARAM <ide> * @see org.springframework.web.servlet.FrameworkServlet#setContextInitializerClasses <ide><path>spring-context/src/main/java/org/springframework/context/ApplicationEvent.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class ApplicationEvent extends EventObject { <ide> <del> /** use serialVersionUID from Spring 1.2 for interoperability */ <add> /** use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = 7099057708183571937L; <ide> <del> /** System time when the event happened */ <add> /** System time when the event happened. */ <ide> private final long timestamp; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface ConfigurableApplicationContext extends ApplicationContext, Life <ide> /** <ide> * Name of the ConversionService bean in the factory. <ide> * If none is supplied, default conversion rules apply. <del> * @see org.springframework.core.convert.ConversionService <ide> * @since 3.0 <add> * @see org.springframework.core.convert.ConversionService <ide> */ <ide> String CONVERSION_SERVICE_BEAN_NAME = "conversionService"; <ide> <ide><path>spring-context/src/main/java/org/springframework/context/EmbeddedValueResolverAware.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> <ide> /** <ide> * Interface to be implemented by any object that wishes to be notified of a <del> * <b>StringValueResolver</b> for the <b> resolution of embedded definition values. <add> * {@code StringValueResolver} for the resolution of embedded definition values. <ide> * <ide> * <p>This is an alternative to a full ConfigurableBeanFactory dependency via the <del> * ApplicationContextAware/BeanFactoryAware interfaces. <add> * {@code ApplicationContextAware}/{@code BeanFactoryAware} interfaces. <ide> * <ide> * @author Juergen Hoeller <ide> * @author Chris Beams <ide><path>spring-context/src/main/java/org/springframework/context/ResourceLoaderAware.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface ResourceLoaderAware extends Aware { <ide> * <p>Invoked after population of normal bean properties but before an init callback <ide> * like InitializingBean's {@code afterPropertiesSet} or a custom init-method. <ide> * Invoked before ApplicationContextAware's {@code setApplicationContext}. <del> * @param resourceLoader ResourceLoader object to be used by this object <add> * @param resourceLoader the ResourceLoader object to be used by this object <ide> * @see org.springframework.core.io.support.ResourcePatternResolver <ide> * @see org.springframework.core.io.support.ResourcePatternUtils#getResourcePatternResolver <ide> */ <ide><path>spring-context/src/main/java/org/springframework/context/annotation/AdviceMode.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public enum AdviceMode { <ide> <add> /** <add> * JDK proxy-based advice. <add> */ <ide> PROXY, <ide> <add> /** <add> * AspectJ weaving-based advice. <add> */ <ide> ASPECTJ <ide> <ide> } <ide><path>spring-context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class AdviceModeImportSelector<A extends Annotation> implements ImportSelector { <ide> <add> /** <add> * The default advice mode attribute name. <add> */ <ide> public static final String DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME = "mode"; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/context/annotation/BeanMethod.java <ide> /* <del> * Copyright 2002-2011 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.core.type.MethodMetadata; <ide> <ide> /** <del> * Represents a {@link Configuration} class method marked with the <del> * {@link Bean} annotation. <add> * Represents a {@link Configuration @Configuration} class method marked with the <add> * {@link Bean @Bean} annotation. <ide> * <ide> * @author Chris Beams <ide> * @author Juergen Hoeller <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConditionContext.java <ide> import org.springframework.lang.Nullable; <ide> <ide> /** <del> * Context information for use by {@link Condition}s. <add> * Context information for use by {@link Condition Conditions}. <ide> * <ide> * @author Phillip Webb <ide> * @author Juergen Hoeller <ide><path>spring-context/src/main/java/org/springframework/context/annotation/Conditional.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public @interface Conditional { <ide> <ide> /** <del> * All {@link Condition}s that must {@linkplain Condition#matches match} <add> * All {@link Condition Conditions} that must {@linkplain Condition#matches match} <ide> * in order for the component to be registered. <ide> */ <ide> Class<? extends Condition>[] value(); <ide><path>spring-context/src/main/java/org/springframework/context/annotation/Configuration.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * {@code AnnotationConfigApplicationContext}, {@code @Configuration} classes may be <ide> * declared as normal {@code <bean>} definitions within Spring XML files: <ide> * <pre class="code"> <del> * {@code <del> * <beans> <del> * <context:annotation-config/> <del> * <bean class="com.acme.AppConfig"/> <del> * </beans>}</pre> <add> * &lt;beans&gt; <add> * &lt;context:annotation-config/&gt; <add> * &lt;bean class="com.acme.AppConfig"/&gt; <add> * &lt;/beans&gt; <add> * </pre> <ide> * <ide> * In the example above, {@code <context:annotation-config/>} is required in order to <ide> * enable {@link ConfigurationClassPostProcessor} and other annotation-related <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java <ide> private interface ConditionalCallback extends Callback { <ide> <ide> <ide> /** <del> * A {@link CallbackFilter} that works by interrogating {@link Callback}s in the order <add> * A {@link CallbackFilter} that works by interrogating {@link Callback Callbacks} in the order <ide> * that they are defined via {@link ConditionalCallback}. <ide> */ <ide> private static class ConditionalCallbackFilter implements CallbackFilter { <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java <ide> SourceClass asSourceClass(@Nullable Class<?> classType) throws IOException { <ide> } <ide> <ide> /** <del> * Factory method to obtain {@link SourceClass}s from class names. <add> * Factory method to obtain {@link SourceClass SourceClasss} from class names. <ide> */ <ide> private Collection<SourceClass> asSourceClasses(String... classNames) throws IOException { <ide> List<SourceClass> annotatedClasses = new ArrayList<>(classNames.length); <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassUtils.java <ide> import org.springframework.stereotype.Component; <ide> <ide> /** <del> * Utilities for identifying @{@link Configuration} classes. <add> * Utilities for identifying {@link Configuration} classes. <ide> * <ide> * @author Chris Beams <ide> * @author Juergen Hoeller <ide> public static boolean isLiteConfigurationClass(BeanDefinition beanDef) { <ide> /** <ide> * Determine the order for the given configuration class metadata. <ide> * @param metadata the metadata of the annotated class <del> * @return the {@link @Order} annotation value on the configuration class, <del> * or {@link Ordered#LOWEST_PRECEDENCE} if none declared <add> * @return the {@code @Order} annotation value on the configuration class, <add> * or {@code Ordered.LOWEST_PRECEDENCE} if none declared <ide> * @since 5.0 <ide> */ <ide> @Nullable <ide> public static Integer getOrder(AnnotationMetadata metadata) { <ide> * Determine the order for the given configuration class bean definition, <ide> * as set by {@link #checkConfigurationClassCandidate}. <ide> * @param beanDef the bean definition to check <del> * @return the {@link @Order} annotation value on the configuration class, <add> * @return the {@link Order @Order} annotation value on the configuration class, <ide> * or {@link Ordered#LOWEST_PRECEDENCE} if none declared <ide> * @since 4.2 <ide> */ <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationCondition.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> <ide> /** <ide> * A {@link Condition} that offers more fine-grained control when used with <del> * {@code @Configuration}. Allows certain {@link Condition}s to adapt when they match <add> * {@code @Configuration}. Allows certain {@link Condition Conditions} to adapt when they match <ide> * based on the configuration phase. For example, a condition that checks if a bean <ide> * has already been registered might choose to only be evaluated during the <ide> * {@link ConfigurationPhase#REGISTER_BEAN REGISTER_BEAN} {@link ConfigurationPhase}. <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ConfigurationMethod.java <ide> /* <del> * Copyright 2002-2013 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.core.type.MethodMetadata; <ide> <ide> /** <add> * Base class for a {@link Configuration @Configuration} class method. <add> * <ide> * @author Chris Beams <ide> * @since 3.1 <ide> */ <ide><path>spring-context/src/main/java/org/springframework/context/annotation/DeferredImportSelector.java <ide> * <ide> * <p>Implementations can also extend the {@link org.springframework.core.Ordered} <ide> * interface or use the {@link org.springframework.core.annotation.Order} annotation to <del> * indicate a precedence against other {@link DeferredImportSelector}s. <add> * indicate a precedence against other {@link DeferredImportSelector DeferredImportSelectors}. <ide> * <ide> * <p>Implementations may also provide an {@link #getImportGroup() import group} which <ide> * can provide additional sorting and filtering logic across different selectors. <ide><path>spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * The example above is equivalent to the following Spring XML configuration: <ide> * <ide> * <pre class="code"> <del> * {@code <del> * <beans> <add> * &lt;beans&gt; <ide> * <del> * <context:load-time-weaver/> <add> * &lt;context:load-time-weaver/&gt; <ide> * <del> * <!-- application-specific <bean> definitions --> <add> * &lt;!-- application-specific &lt;bean&gt; definitions --&gt; <ide> * <del> * </beans> <del> * }</pre> <add> * &lt;/beans&gt; <add> * </pre> <ide> * <ide> * <h2>The {@code LoadTimeWeaverAware} interface</h2> <ide> * Any bean that implements the {@link <ide> * <p>The example above can be compared to the following Spring XML configuration: <ide> * <ide> * <pre class="code"> <del> * {@code <del> * <beans> <add> * &lt;beans&gt; <ide> * <del> * <context:load-time-weaver weaverClass="com.acme.MyLoadTimeWeaver"/> <add> * &lt;context:load-time-weaver weaverClass="com.acme.MyLoadTimeWeaver"/&gt; <ide> * <del> * </beans> <del> * }</pre> <add> * &lt;/beans&gt; <add> * </pre> <ide> * <ide> * <p>The code example differs from the XML example in that it actually instantiates the <ide> * {@code MyLoadTimeWeaver} type, meaning that it can also configure the instance, e.g. <ide> * <p>The example above can be compared to the following Spring XML configuration: <ide> * <ide> * <pre class="code"> <del> * {@code <del> * <beans> <add> * &lt;beans&gt; <ide> * <del> * <context:load-time-weaver aspectj-weaving="on"/> <add> * &lt;context:load-time-weaver aspectj-weaving="on"/&gt; <ide> * <del> * </beans> <del> * }</pre> <add> * &lt;/beans&gt; <add> * </pre> <ide> * <ide> * <p>The two examples are equivalent with one significant exception: in the XML case, <ide> * the functionality of {@code <context:spring-configured>} is implicitly enabled when <ide> AspectJWeaving aspectjWeaving() default AspectJWeaving.AUTODETECT; <ide> <ide> <add> /** <add> * AspectJ weaving enablement options. <add> */ <ide> enum AspectJWeaving { <ide> <ide> /** <ide><path>spring-context/src/main/java/org/springframework/context/annotation/ImportRegistry.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.lang.Nullable; <ide> <ide> /** <add> * Registry of imported class {@link AnnotationMetadata}. <add> * <ide> * @author Juergen Hoeller <del> * @author Phil Webb <add> * @author Phillip Webb <ide> */ <ide> interface ImportRegistry { <ide> <ide><path>spring-context/src/main/java/org/springframework/context/annotation/MBeanExportConfiguration.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> private void setupRegistrationPolicy(AnnotationMBeanExporter exporter, Annotatio <ide> } <ide> <ide> <add> /** <add> * Specific platforms that might need custom MBean handling. <add> */ <ide> public enum SpecificPlatform { <ide> <add> /** <add> * Weblogic. <add> */ <ide> WEBLOGIC("weblogic.management.Helper") { <ide> @Override <ide> public MBeanServer getMBeanServer() { <ide> public MBeanServer getMBeanServer() { <ide> } <ide> }, <ide> <add> /** <add> * Websphere. <add> */ <ide> WEBSPHERE("com.ibm.websphere.management.AdminServiceFactory") { <ide> @Override <ide> public MBeanServer getMBeanServer() { <ide><path>spring-context/src/main/java/org/springframework/context/event/SmartApplicationListener.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * Extended variant of the standard {@link ApplicationListener} interface, <ide> * exposing further metadata such as the supported event type. <ide> * <del> * <p>Users are <bold>strongly advised</bold> to use the {@link GenericApplicationListener} <add> * <p>Users are <b>strongly advised</b> to use the {@link GenericApplicationListener} <ide> * interface instead as it provides an improved detection of generics-based <ide> * event types. <ide> * <ide><path>spring-context/src/main/java/org/springframework/context/expression/CachedExpressionEvaluator.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> private ExpressionKey createKey(AnnotatedElementKey elementKey, String expressio <ide> } <ide> <ide> <add> /** <add> * An expression key. <add> */ <ide> protected static class ExpressionKey implements Comparable<ExpressionKey> { <ide> <ide> private final AnnotatedElementKey element; <ide><path>spring-context/src/main/java/org/springframework/context/expression/StandardBeanExpressionResolver.java <ide> */ <ide> public class StandardBeanExpressionResolver implements BeanExpressionResolver { <ide> <del> /** Default expression prefix: "#{" */ <add> /** Default expression prefix: "#{". */ <ide> public static final String DEFAULT_EXPRESSION_PREFIX = "#{"; <ide> <del> /** Default expression suffix: "}" */ <add> /** Default expression suffix: "}". */ <ide> public static final String DEFAULT_EXPRESSION_SUFFIX = "}"; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java <ide> public abstract class AbstractApplicationContext extends DefaultResourceLoader <ide> /** Logger used by this class. Available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <del> /** Unique id for this context, if any */ <add> /** Unique id for this context, if any. */ <ide> private String id = ObjectUtils.identityToString(this); <ide> <del> /** Display name */ <add> /** Display name. */ <ide> private String displayName = ObjectUtils.identityToString(this); <ide> <del> /** Parent context */ <add> /** Parent context. */ <ide> @Nullable <ide> private ApplicationContext parent; <ide> <del> /** Environment used by this context */ <add> /** Environment used by this context. */ <ide> @Nullable <ide> private ConfigurableEnvironment environment; <ide> <del> /** BeanFactoryPostProcessors to apply on refresh */ <add> /** BeanFactoryPostProcessors to apply on refresh. */ <ide> private final List<BeanFactoryPostProcessor> beanFactoryPostProcessors = new ArrayList<>(); <ide> <del> /** System time in milliseconds when this context started */ <add> /** System time in milliseconds when this context started. */ <ide> private long startupDate; <ide> <del> /** Flag that indicates whether this context is currently active */ <add> /** Flag that indicates whether this context is currently active. */ <ide> private final AtomicBoolean active = new AtomicBoolean(); <ide> <del> /** Flag that indicates whether this context has been closed already */ <add> /** Flag that indicates whether this context has been closed already. */ <ide> private final AtomicBoolean closed = new AtomicBoolean(); <ide> <del> /** Synchronization monitor for the "refresh" and "destroy" */ <add> /** Synchronization monitor for the "refresh" and "destroy". */ <ide> private final Object startupShutdownMonitor = new Object(); <ide> <del> /** Reference to the JVM shutdown hook, if registered */ <add> /** Reference to the JVM shutdown hook, if registered. */ <ide> @Nullable <ide> private Thread shutdownHook; <ide> <del> /** ResourcePatternResolver used by this context */ <add> /** ResourcePatternResolver used by this context. */ <ide> private ResourcePatternResolver resourcePatternResolver; <ide> <del> /** LifecycleProcessor for managing the lifecycle of beans within this context */ <add> /** LifecycleProcessor for managing the lifecycle of beans within this context. */ <ide> @Nullable <ide> private LifecycleProcessor lifecycleProcessor; <ide> <del> /** MessageSource we delegate our implementation of this interface to */ <add> /** MessageSource we delegate our implementation of this interface to. */ <ide> @Nullable <ide> private MessageSource messageSource; <ide> <del> /** Helper class used in event publishing */ <add> /** Helper class used in event publishing. */ <ide> @Nullable <ide> private ApplicationEventMulticaster applicationEventMulticaster; <ide> <del> /** Statically specified listeners */ <add> /** Statically specified listeners. */ <ide> private final Set<ApplicationListener<?>> applicationListeners = new LinkedHashSet<>(); <ide> <del> /** ApplicationEvents published early */ <add> /** ApplicationEvents published early. */ <ide> @Nullable <ide> private Set<ApplicationEvent> earlyApplicationEvents; <ide> <ide><path>spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class AbstractRefreshableApplicationContext extends AbstractAppl <ide> @Nullable <ide> private Boolean allowCircularReferences; <ide> <del> /** Bean factory for this context */ <add> /** Bean factory for this context. */ <ide> @Nullable <ide> private DefaultListableBeanFactory beanFactory; <ide> <del> /** Synchronization monitor for the internal BeanFactory */ <add> /** Synchronization monitor for the internal BeanFactory. */ <ide> private final Object beanFactoryMonitor = new Object(); <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/context/support/ApplicationObjectSupport.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class ApplicationObjectSupport implements ApplicationContextAware { <ide> <del> /** Logger that is available to subclasses */ <add> /** Logger that is available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <del> /** ApplicationContext this object runs in */ <add> /** ApplicationContext this object runs in. */ <ide> @Nullable <ide> private ApplicationContext applicationContext; <ide> <del> /** MessageSourceAccessor for easy message access */ <add> /** MessageSourceAccessor for easy message access. */ <ide> @Nullable <ide> private MessageSourceAccessor messageSourceAccessor; <ide> <ide> protected Class<?> requiredContextClass() { <ide> /** <ide> * Subclasses can override this for custom initialization behavior. <ide> * Gets called by {@code setApplicationContext} after setting the context instance. <del> * <p>Note: Does </i>not</i> get called on reinitialization of the context <add> * <p>Note: Does <i>not</i> get called on re-initialization of the context <ide> * but rather just on first initialization of this object's context reference. <ide> * <p>The default implementation calls the overloaded {@link #initApplicationContext()} <ide> * method without ApplicationContext reference. <ide><path>spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> class ContextTypeMatchClassLoader extends DecoratingClassLoader implements Smart <ide> } <ide> <ide> <del> /** Cache for byte array per class name */ <add> /** Cache for byte array per class name. */ <ide> private final Map<String, byte[]> bytesCache = new ConcurrentHashMap<>(256); <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java <ide> private void startBeans(boolean autoStartupOnly) { <ide> /** <ide> * Start the specified bean as part of the given set of Lifecycle beans, <ide> * making sure that any beans that it depends on are started first. <del> * @param lifecycleBeans Map with bean name as key and Lifecycle instance as value <add> * @param lifecycleBeans a Map with bean name as key and Lifecycle instance as value <ide> * @param beanName the name of the bean to start <ide> */ <ide> private void doStart(Map<String, ? extends Lifecycle> lifecycleBeans, String beanName, boolean autoStartupOnly) { <ide> private void stopBeans() { <ide> /** <ide> * Stop the specified bean as part of the given set of Lifecycle beans, <ide> * making sure that any beans that depends on it are stopped first. <del> * @param lifecycleBeans Map with bean name as key and Lifecycle instance as value <add> * @param lifecycleBeans a Map with bean name as key and Lifecycle instance as value <ide> * @param beanName the name of the bean to stop <ide> */ <ide> private void doStop(Map<String, ? extends Lifecycle> lifecycleBeans, final String beanName, <ide><path>spring-context/src/main/java/org/springframework/context/support/FileSystemXmlApplicationContext.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public FileSystemXmlApplicationContext( <ide> * interpreted as relative to the current VM working directory. <ide> * This is consistent with the semantics in a Servlet container. <ide> * @param path path to the resource <del> * @return Resource handle <add> * @return the Resource handle <ide> * @see org.springframework.web.context.support.XmlWebApplicationContext#getResourceByPath <ide> */ <ide> @Override <ide><path>spring-context/src/main/java/org/springframework/context/support/LiveBeansView.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class LiveBeansView implements LiveBeansViewMBean, ApplicationContextAware { <ide> <add> /** <add> * The "MBean Domain" property name. <add> */ <ide> public static final String MBEAN_DOMAIN_PROPERTY_NAME = "spring.liveBeansView.mbeanDomain"; <ide> <add> /** <add> * The MBean application key. <add> */ <ide> public static final String MBEAN_APPLICATION_KEY = "application"; <ide> <ide> private static final Set<ConfigurableApplicationContext> applicationContexts = new LinkedHashSet<>(); <ide><path>spring-context/src/main/java/org/springframework/context/support/MessageSourceAccessor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> protected Locale getDefaultLocale() { <ide> /** <ide> * Retrieve the message for the given code and the default Locale. <ide> * @param code code of the message <del> * @param defaultMessage String to return if the lookup fails <add> * @param defaultMessage the String to return if the lookup fails <ide> * @return the message <ide> */ <ide> public String getMessage(String code, String defaultMessage) { <ide> public String getMessage(String code, String defaultMessage) { <ide> /** <ide> * Retrieve the message for the given code and the given Locale. <ide> * @param code code of the message <del> * @param defaultMessage String to return if the lookup fails <del> * @param locale Locale in which to do lookup <add> * @param defaultMessage the String to return if the lookup fails <add> * @param locale the Locale in which to do lookup <ide> * @return the message <ide> */ <ide> public String getMessage(String code, String defaultMessage, Locale locale) { <ide> public String getMessage(String code, String defaultMessage, Locale locale) { <ide> * Retrieve the message for the given code and the default Locale. <ide> * @param code code of the message <ide> * @param args arguments for the message, or {@code null} if none <del> * @param defaultMessage String to return if the lookup fails <add> * @param defaultMessage the String to return if the lookup fails <ide> * @return the message <ide> */ <ide> public String getMessage(String code, @Nullable Object[] args, String defaultMessage) { <ide> public String getMessage(String code, @Nullable Object[] args, String defaultMes <ide> * Retrieve the message for the given code and the given Locale. <ide> * @param code code of the message <ide> * @param args arguments for the message, or {@code null} if none <del> * @param defaultMessage String to return if the lookup fails <del> * @param locale Locale in which to do lookup <add> * @param defaultMessage the String to return if the lookup fails <add> * @param locale the Locale in which to do lookup <ide> * @return the message <ide> */ <ide> public String getMessage(String code, @Nullable Object[] args, String defaultMessage, Locale locale) { <ide> public String getMessage(String code) throws NoSuchMessageException { <ide> /** <ide> * Retrieve the message for the given code and the given Locale. <ide> * @param code code of the message <del> * @param locale Locale in which to do lookup <add> * @param locale the Locale in which to do lookup <ide> * @return the message <ide> * @throws org.springframework.context.NoSuchMessageException if not found <ide> */ <ide> public String getMessage(String code, @Nullable Object[] args) throws NoSuchMess <ide> * Retrieve the message for the given code and the given Locale. <ide> * @param code code of the message <ide> * @param args arguments for the message, or {@code null} if none <del> * @param locale Locale in which to do lookup <add> * @param locale the Locale in which to do lookup <ide> * @return the message <ide> * @throws org.springframework.context.NoSuchMessageException if not found <ide> */ <ide> public String getMessage(MessageSourceResolvable resolvable) throws NoSuchMessag <ide> * Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance) <ide> * in the given Locale. <ide> * @param resolvable the MessageSourceResolvable <del> * @param locale Locale in which to do lookup <add> * @param locale the Locale in which to do lookup <ide> * @return the message <ide> * @throws org.springframework.context.NoSuchMessageException if not found <ide> */ <ide><path>spring-context/src/main/java/org/springframework/context/support/MessageSourceSupport.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class MessageSourceSupport { <ide> <ide> private static final MessageFormat INVALID_MESSAGE_FORMAT = new MessageFormat(""); <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> private boolean alwaysUseMessageFormat = false; <ide><path>spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java <ide> public class ReloadableResourceBundleMessageSource extends AbstractResourceBased <ide> /** <ide> * Set per-file charsets to use for parsing properties files. <ide> * <p>Only applies to classic properties files, not to XML files. <del> * @param fileEncodings Properties with filenames as keys and charset <add> * @param fileEncodings a Properties with filenames as keys and charset <ide> * names as values. Filenames have to match the basename syntax, <ide> * with optional locale-specific components: e.g. "WEB-INF/messages" <ide> * or "WEB-INF/messages_en". <ide> protected class PropertiesHolder { <ide> <ide> private final ReentrantLock refreshLock = new ReentrantLock(); <ide> <del> /** Cache to hold already generated MessageFormats per message code */ <add> /** Cache to hold already generated MessageFormats per message code. */ <ide> private final ConcurrentMap<String, Map<Locale, MessageFormat>> cachedMessageFormats = <ide> new ConcurrentHashMap<>(); <ide> <ide><path>spring-context/src/main/java/org/springframework/context/support/StaticMessageSource.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class StaticMessageSource extends AbstractMessageSource { <ide> <del> /** Map from 'code + locale' keys to message Strings */ <add> /** Map from 'code + locale' keys to message Strings. */ <ide> private final Map<String, String> messages = new HashMap<>(); <ide> <ide> private final Map<String, MessageFormat> cachedMessageFormats = new HashMap<>(); <ide><path>spring-context/src/main/java/org/springframework/context/weaving/AspectJWeavingEnabler.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class AspectJWeavingEnabler <ide> implements BeanFactoryPostProcessor, BeanClassLoaderAware, LoadTimeWeaverAware, Ordered { <ide> <add> /** <add> * The {@code aop.xml} resource location. <add> */ <ide> public static final String ASPECTJ_AOP_XML_RESOURCE = "META-INF/aop.xml"; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class LocalStatelessSessionProxyFactoryBean extends LocalSlsbInvokerInterceptor <ide> implements FactoryBean<Object>, BeanClassLoaderAware { <ide> <del> /** The business interface of the EJB we're proxying */ <add> /** The business interface of the EJB we're proxying. */ <ide> @Nullable <ide> private Class<?> businessInterface; <ide> <ide> @Nullable <ide> private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); <ide> <del> /** EJBLocalObject */ <add> /** EJBLocalObject. */ <ide> @Nullable <ide> private Object proxy; <ide> <ide><path>spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class SimpleRemoteStatelessSessionProxyFactoryBean extends SimpleRemoteSlsbInvokerInterceptor <ide> implements FactoryBean<Object>, BeanClassLoaderAware { <ide> <del> /** The business interface of the EJB we're proxying */ <add> /** The business interface of the EJB we're proxying. */ <ide> @Nullable <ide> private Class<?> businessInterface; <ide> <ide> @Nullable <ide> private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); <ide> <del> /** EJBObject */ <add> /** EJBObject. */ <ide> @Nullable <ide> private Object proxy; <ide> <ide><path>spring-context/src/main/java/org/springframework/format/FormatterRegistry.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface FormatterRegistry extends ConverterRegistry { <ide> * Adds a Formatter to format fields of a specific type. <ide> * The field type is implied by the parameterized Formatter instance. <ide> * @param formatter the formatter to add <del> * @see #addFormatterForFieldType(Class, Formatter) <ide> * @since 3.1 <add> * @see #addFormatterForFieldType(Class, Formatter) <ide> */ <ide> void addFormatter(Formatter<?> formatter); <ide> <ide><path>spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public void setStyle(int style) { <ide> * <li>'L' = Long</li> <ide> * <li>'F' = Full</li> <ide> * <li>'-' = Omitted</li> <del> * <ul> <add> * </ul> <ide> * This method mimics the styles supported by Joda-Time. <ide> * @param stylePattern two characters from the set {"S", "M", "L", "F", "-"} <ide> * @since 3.2 <ide><path>spring-context/src/main/java/org/springframework/format/support/DefaultFormattingConversionService.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public DefaultFormattingConversionService(boolean registerDefaultFormatters) { <ide> * Create a new {@code DefaultFormattingConversionService} with the set of <ide> * {@linkplain DefaultConversionService#addDefaultConverters default converters} and, <ide> * based on the value of {@code registerDefaultFormatters}, the set of <del> * {@linkplain #addDefaultFormatters default formatters} <add> * {@linkplain #addDefaultFormatters default formatters}. <ide> * @param embeddedValueResolver delegated to {@link #setEmbeddedValueResolver(StringValueResolver)} <ide> * prior to calling {@link #addDefaultFormatters}. <ide> * @param registerDefaultFormatters whether to register default formatters <ide><path>spring-context/src/main/java/org/springframework/instrument/classloading/ResourceOverridingShadowingClassLoader.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public URL nextElement() { <ide> <ide> <ide> /** <del> * Key is asked for value: value is actual value <add> * Key is asked for value: value is actual value. <ide> */ <ide> private Map<String, String> overrides = new HashMap<>(); <ide> <ide><path>spring-context/src/main/java/org/springframework/instrument/classloading/ShadowingClassLoader.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class ShadowingClassLoader extends DecoratingClassLoader { <ide> <del> /** Packages that are excluded by default */ <add> /** Packages that are excluded by default. */ <ide> public static final String[] DEFAULT_EXCLUDED_PACKAGES = <ide> new String[] {"java.", "javax.", "sun.", "oracle.", "com.sun.", "com.ibm.", "COM.ibm.", <ide> "org.w3c.", "org.xml.", "org.dom4j.", "org.eclipse", "org.aspectj.", "net.sf.cglib", <ide><path>spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class MBeanClientInterceptor <ide> implements MethodInterceptor, BeanClassLoaderAware, InitializingBean, DisposableBean { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> @Nullable <ide><path>spring-context/src/main/java/org/springframework/jmx/access/NotificationListenerRegistrar.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class NotificationListenerRegistrar extends NotificationListenerHolder <ide> implements InitializingBean, DisposableBean { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> private final ConnectorDelegate connector = new ConnectorDelegate(); <ide><path>spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java <ide> public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo <ide> */ <ide> private static final String WILDCARD = "*"; <ide> <del> /** Constant for the JMX {@code mr_type} "ObjectReference" */ <add> /** Constant for the JMX {@code mr_type} "ObjectReference". */ <ide> private static final String MR_TYPE_OBJECT_REFERENCE = "ObjectReference"; <ide> <del> /** Prefix for the autodetect constants defined in this class */ <add> /** Prefix for the autodetect constants defined in this class. */ <ide> private static final String CONSTANT_PREFIX_AUTODETECT = "AUTODETECT_"; <ide> <ide> <del> /** Constants instance for this class */ <add> /** Constants instance for this class. */ <ide> private static final Constants constants = new Constants(MBeanExporter.class); <ide> <del> /** The beans to be exposed as JMX managed resources, with JMX names as keys */ <add> /** The beans to be exposed as JMX managed resources, with JMX names as keys. */ <ide> @Nullable <ide> private Map<String, Object> beans; <ide> <del> /** The autodetect mode to use for this MBeanExporter */ <add> /** The autodetect mode to use for this MBeanExporter. */ <ide> @Nullable <ide> private Integer autodetectMode; <ide> <del> /** Whether to eagerly initialize candidate beans when autodetecting MBeans */ <add> /** Whether to eagerly initialize candidate beans when autodetecting MBeans. */ <ide> private boolean allowEagerInit = false; <ide> <del> /** Stores the MBeanInfoAssembler to use for this exporter */ <add> /** Stores the MBeanInfoAssembler to use for this exporter. */ <ide> private MBeanInfoAssembler assembler = new SimpleReflectiveMBeanInfoAssembler(); <ide> <del> /** The strategy to use for creating ObjectNames for an object */ <add> /** The strategy to use for creating ObjectNames for an object. */ <ide> private ObjectNamingStrategy namingStrategy = new KeyNamingStrategy(); <ide> <del> /** Indicates whether Spring should modify generated ObjectNames */ <add> /** Indicates whether Spring should modify generated ObjectNames. */ <ide> private boolean ensureUniqueRuntimeObjectNames = true; <ide> <del> /** Indicates whether Spring should expose the managed resource ClassLoader in the MBean */ <add> /** Indicates whether Spring should expose the managed resource ClassLoader in the MBean. */ <ide> private boolean exposeManagedResourceClassLoader = true; <ide> <del> /** A set of bean names that should be excluded from autodetection */ <add> /** A set of bean names that should be excluded from autodetection. */ <ide> private Set<String> excludedBeans = new HashSet<>(); <ide> <ide> /** The MBeanExporterListeners registered with this exporter. */ <ide> @Nullable <ide> private MBeanExporterListener[] listeners; <ide> <del> /** The NotificationListeners to register for the MBeans registered by this exporter */ <add> /** The NotificationListeners to register for the MBeans registered by this exporter. */ <ide> @Nullable <ide> private NotificationListenerBean[] notificationListeners; <ide> <del> /** Map of actually registered NotificationListeners */ <add> /** Map of actually registered NotificationListeners. */ <ide> private final Map<NotificationListenerBean, ObjectName[]> registeredNotificationListeners = new LinkedHashMap<>(); <ide> <del> /** Stores the ClassLoader to use for generating lazy-init proxies */ <add> /** Stores the ClassLoader to use for generating lazy-init proxies. */ <ide> @Nullable <ide> private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); <ide> <del> /** Stores the BeanFactory for use in autodetection process */ <add> /** Stores the BeanFactory for use in autodetection process. */ <ide> @Nullable <ide> private ListableBeanFactory beanFactory; <ide> <ide> public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo <ide> * Bean instances are typically linked in through bean references. <ide> * Bean names will be resolved as beans in the current factory, respecting <ide> * lazy-init markers (that is, not triggering initialization of such beans). <del> * @param beans Map with JMX names as keys and bean instances or bean names <add> * @param beans a Map with JMX names as keys and bean instances or bean names <ide> * as values <ide> * @see #setNamingStrategy <ide> * @see org.springframework.jmx.export.naming.KeyNamingStrategy <ide> protected void onUnregister(ObjectName objectName) { <ide> } <ide> <ide> <del> /** <add> /** <ide> * Notifies all registered {@link MBeanExporterListener MBeanExporterListeners} of the <ide> * registration of the MBean identified by the supplied {@link ObjectName}. <ide> */ <ide><path>spring-context/src/main/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssembler.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class InterfaceBasedMBeanInfoAssembler extends AbstractConfigurableMBeanI <ide> @Nullable <ide> private Class<?>[] managedInterfaces; <ide> <del> /** Mappings of bean keys to an array of classes */ <add> /** Mappings of bean keys to an array of classes. */ <ide> @Nullable <ide> private Properties interfaceMappings; <ide> <ide> @Nullable <ide> private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); <ide> <del> /** Mappings of bean keys to an array of classes */ <add> /** Mappings of bean keys to an array of classes. */ <ide> @Nullable <ide> private Map<String, Class<?>[]> resolvedInterfaceMappings; <ide> <ide><path>spring-context/src/main/java/org/springframework/jmx/export/assembler/SimpleReflectiveMBeanInfoAssembler.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> protected boolean includeWriteAttribute(Method method, String beanKey) { <ide> return true; <ide> } <ide> <del> /** <del> * Always returns {@code true}. <del> */ <add> /** <add> * Always returns {@code true}. <add> */ <ide> @Override <ide> protected boolean includeOperation(Method method, String beanKey) { <ide> return true; <ide><path>spring-context/src/main/java/org/springframework/jmx/export/metadata/ManagedAttribute.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class ManagedAttribute extends AbstractJmxAttribute { <ide> <add> /** <add> * Empty attributes. <add> */ <ide> public static final ManagedAttribute EMPTY = new ManagedAttribute(); <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/jmx/export/naming/IdentityNamingStrategy.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class IdentityNamingStrategy implements ObjectNamingStrategy { <ide> <add> /** <add> * The type key. <add> */ <ide> public static final String TYPE_KEY = "type"; <ide> <add> /** <add> * The hash code key. <add> */ <ide> public static final String HASH_CODE_KEY = "hashCode"; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/jmx/export/notification/ModelMBeanNotificationPublisher.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public void sendNotification(Notification notification) { <ide> } <ide> <ide> /** <add> * Replaces the notification source if necessary to do so. <ide> * From the {@link Notification javadoc}: <del> * <p><i>"It is strongly recommended that notification senders use the object name <add> * <i>"It is strongly recommended that notification senders use the object name <ide> * rather than a reference to the MBean object as the source."</i> <ide> * @param notification the {@link Notification} whose <ide> * {@link javax.management.Notification#getSource()} might need massaging <ide><path>spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class ConnectorServerFactoryBean extends MBeanRegistrationSupport <ide> implements FactoryBean<JMXConnectorServer>, InitializingBean, DisposableBean { <ide> <del> /** The default service URL */ <add> /** The default service URL. */ <ide> public static final String DEFAULT_SERVICE_URL = "service:jmx:jmxmp://localhost:9875"; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> private void connect() throws IOException { <ide> } <ide> <ide> /** <del> * Creates lazy proxies for the {@code JMXConnector} and {@code MBeanServerConnection} <add> * Creates lazy proxies for the {@code JMXConnector} and {@code MBeanServerConnection}. <ide> */ <ide> private void createLazyConnection() { <ide> this.connectorTargetSource = new JMXConnectorLazyInitTargetSource(); <ide><path>spring-context/src/main/java/org/springframework/jndi/JndiCallback.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * convenience methods. <ide> * <ide> * @author Rod Johnson <add> * @param <T> the resulting object type <ide> * @see JndiTemplate <ide> * @see org.springframework.jdbc.core.JdbcTemplate <ide> */ <ide><path>spring-context/src/main/java/org/springframework/jndi/JndiLocatorSupport.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class JndiLocatorSupport extends JndiAccessor { <ide> <del> /** JNDI prefix used in a Java EE container */ <add> /** JNDI prefix used in a Java EE container. */ <ide> public static final String CONTAINER_PREFIX = "java:comp/env/"; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/jndi/JndiTemplate.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public Properties getEnvironment() { <ide> <ide> /** <ide> * Execute the given JNDI context callback implementation. <del> * @param contextCallback JndiCallback implementation <add> * @param contextCallback the JndiCallback implementation to use <ide> * @return a result object returned by the callback, or {@code null} <ide> * @throws NamingException thrown by the callback implementation <ide> * @see #createInitialContext <ide><path>spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java <ide> public class SimpleJndiBeanFactory extends JndiLocatorSupport implements BeanFac <ide> /** JNDI names of resources that are known to be shareable, i.e. can be cached */ <ide> private final Set<String> shareableResources = new HashSet<>(); <ide> <del> /** Cache of shareable singleton objects: bean name --> bean instance */ <add> /** Cache of shareable singleton objects: bean name to bean instance. */ <ide> private final Map<String, Object> singletonObjects = new HashMap<>(); <ide> <del> /** Cache of the types of nonshareable resources: bean name --> bean type */ <add> /** Cache of the types of nonshareable resources: bean name to bean type. */ <ide> private final Map<String, Class<?>> resourceTypes = new HashMap<>(); <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/remoting/RemoteAccessException.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class RemoteAccessException extends NestedRuntimeException { <ide> <del> /** Use serialVersionUID from Spring 1.2 for interoperability */ <add> /** Use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = -4906825139312227864L; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/remoting/rmi/RemoteInvocationSerializingExporter.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class RemoteInvocationSerializingExporter extends RemoteInvocati <ide> implements InitializingBean { <ide> <ide> /** <del> * Default content type: "application/x-java-serialized-object" <add> * Default content type: "application/x-java-serialized-object". <ide> */ <ide> public static final String CONTENT_TYPE_SERIALIZED_OBJECT = "application/x-java-serialized-object"; <ide> <ide><path>spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationWrapper.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> class RmiInvocationWrapper implements RmiInvocationHandler { <ide> <ide> <ide> /** <del> * Create a new RmiInvocationWrapper for the given object <add> * Create a new RmiInvocationWrapper for the given object. <ide> * @param wrappedObject the object to wrap with an RmiInvocationHandler <ide> * @param rmiExporter the RMI exporter to handle the actual invocation <ide> */ <ide><path>spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocation.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class RemoteInvocation implements Serializable { <ide> <del> /** use serialVersionUID from Spring 1.1 for interoperability */ <add> /** use serialVersionUID from Spring 1.1 for interoperability. */ <ide> private static final long serialVersionUID = 6876024250231820554L; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationResult.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class RemoteInvocationResult implements Serializable { <ide> <del> /** Use serialVersionUID from Spring 1.1 for interoperability */ <add> /** Use serialVersionUID from Spring 1.1 for interoperability. */ <ide> private static final long serialVersionUID = 2138555143707773549L; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/remoting/support/RemotingSupport.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class RemotingSupport implements BeanClassLoaderAware { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); <ide><path>spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncResult.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Juergen Hoeller <ide> * @author Rossen Stoyanchev <ide> * @since 3.0 <add> * @param <V> the value type <ide> * @see Async <ide> * @see #forValue(Object) <ide> * @see #forExecutionException(Throwable) <ide><path>spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * configuration: <ide> * <ide> * <pre class="code"> <del> * {@code <del> * <beans> <add> * &lt;beans&gt; <ide> * <del> * <task:annotation-driven executor="myExecutor" exception-handler="exceptionHandler"/> <add> * &lt;task:annotation-driven executor="myExecutor" exception-handler="exceptionHandler"/&gt; <ide> * <del> * <task:executor id="myExecutor" pool-size="7-42" queue-capacity="11"/> <add> * &lt;task:executor id="myExecutor" pool-size="7-42" queue-capacity="11"/&gt; <ide> * <del> * <bean id="asyncBean" class="com.foo.MyAsyncBean"/> <add> * &lt;bean id="asyncBean" class="com.foo.MyAsyncBean"/&gt; <ide> * <del> * <bean id="exceptionHandler" class="com.foo.MyAsyncUncaughtExceptionHandler"/> <add> * &lt;bean id="exceptionHandler" class="com.foo.MyAsyncUncaughtExceptionHandler"/&gt; <ide> * <del> * </beans> <del> * }</pre> <add> * &lt;/beans&gt; <add> * </pre> <ide> * <ide> * The above XML-based and JavaConfig-based examples are equivalent except for the <ide> * setting of the <em>thread name prefix</em> of the {@code Executor}; this is because <ide><path>spring-context/src/main/java/org/springframework/scheduling/annotation/EnableScheduling.java <ide> * configuration: <ide> * <ide> * <pre class="code"> <del> * {@code <del> * <beans> <add> * &lt;beans> <ide> * <del> * <task:annotation-driven scheduler="taskScheduler"/> <add> * &lt;task:annotation-driven scheduler="taskScheduler"/&gt; <ide> * <del> * <task:scheduler id="taskScheduler" pool-size="42"/> <add> * &lt;task:scheduler id="taskScheduler" pool-size="42"/&gt; <ide> * <del> * <task:scheduled-tasks scheduler="taskScheduler"> <del> * <task:scheduled ref="myTask" method="work" fixed-rate="1000"/> <del> * </task:scheduled-tasks> <add> * &lt;task:scheduled-tasks scheduler="taskScheduler"&gt; <add> * &lt;task:scheduled ref="myTask" method="work" fixed-rate="1000"/&gt; <add> * &lt;/task:scheduled-tasks&gt; <ide> * <del> * <bean id="myTask" class="com.foo.MyTask"/> <add> * &lt;bean id="myTask" class="com.foo.MyTask"/&gt; <ide> * <del> * </beans> <del> * }</pre> <add> * &lt;/beans&gt; <add> * </pre> <ide> * <ide> * The examples are equivalent save that in XML a <em>fixed-rate</em> period is used <ide> * instead of a custom <em>{@code Trigger}</em> implementation; this is because the <ide><path>spring-context/src/main/java/org/springframework/scheduling/annotation/SchedulingConfigurer.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface SchedulingConfigurer { <ide> /** <ide> * Callback allowing a {@link org.springframework.scheduling.TaskScheduler <ide> * TaskScheduler} and specific {@link org.springframework.scheduling.config.Task Task} <del> * instances to be registered against the given the {@link ScheduledTaskRegistrar} <add> * instances to be registered against the given the {@link ScheduledTaskRegistrar}. <ide> * @param taskRegistrar the registrar to be configured. <ide> */ <ide> void configureTasks(ScheduledTaskRegistrar taskRegistrar); <ide><path>spring-context/src/main/java/org/springframework/scheduling/config/ScheduledTaskRegistrar.java <ide> public void addTriggerTask(TriggerTask task) { <ide> } <ide> <ide> /** <del> * Add a Runnable task to be triggered per the given cron expression <add> * Add a Runnable task to be triggered per the given cron expression. <ide> */ <ide> public void addCronTask(Runnable task, String expression) { <ide> addCronTask(new CronTask(task, expression)); <ide><path>spring-context/src/main/java/org/springframework/scheduling/support/PeriodicTrigger.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * fixed-rate or fixed-delay, and an initial delay value may also be configured. <ide> * The default initial delay is 0, and the default behavior is fixed-delay <ide> * (i.e. the interval between successive executions is measured from each <del> * <emphasis>completion</emphasis> time). To measure the interval between the <del> * scheduled <emphasis>start</emphasis> time of each execution instead, set the <add> * <i>completion</i> time). To measure the interval between the <add> * scheduled <i>start</i> time of each execution instead, set the <ide> * 'fixedRate' property to {@code true}. <ide> * <ide> * <p>Note that the TaskScheduler interface already defines methods for scheduling <ide><path>spring-context/src/main/java/org/springframework/scheduling/support/SimpleTriggerContext.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class SimpleTriggerContext implements TriggerContext { <ide> /** <ide> * Create a SimpleTriggerContext with all time values set to {@code null}. <ide> */ <del> public SimpleTriggerContext() { <add> public SimpleTriggerContext() { <ide> } <ide> <ide> /** <ide><path>spring-context/src/main/java/org/springframework/scripting/config/LangNamespaceUtils.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.scripting.support.ScriptFactoryPostProcessor; <ide> <ide> /** <add> * Utilities for use with {@link LangNamespaceHandler}. <add> * <ide> * @author Rob Harrop <ide> * @author Mark Fisher <ide> * @since 2.5 <ide><path>spring-context/src/main/java/org/springframework/scripting/config/ScriptingDefaultsParser.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.util.StringUtils; <ide> <ide> /** <add> * A {@link BeanDefinitionParser} for use when loading scripting XML. <add> * <ide> * @author Mark Fisher <ide> * @since 2.5 <ide> */ <ide><path>spring-context/src/main/java/org/springframework/scripting/support/ResourceScriptSource.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class ResourceScriptSource implements ScriptSource { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> private EncodedResource resource; <ide><path>spring-context/src/main/java/org/springframework/scripting/support/ScriptFactoryPostProcessor.java <ide> public class ScriptFactoryPostProcessor extends InstantiationAwareBeanPostProces <ide> */ <ide> public static final String INLINE_SCRIPT_PREFIX = "inline:"; <ide> <add> /** <add> * The {@code refreshCheckDelay} attribute. <add> */ <ide> public static final String REFRESH_CHECK_DELAY_ATTRIBUTE = Conventions.getQualifiedAttributeName( <ide> ScriptFactoryPostProcessor.class, "refreshCheckDelay"); <ide> <add> /** <add> * The {@code proxyTargetClass} attribute. <add> */ <ide> public static final String PROXY_TARGET_CLASS_ATTRIBUTE = Conventions.getQualifiedAttributeName( <ide> ScriptFactoryPostProcessor.class, "proxyTargetClass"); <ide> <add> /** <add> * The {@code language} attribute. <add> */ <ide> public static final String LANGUAGE_ATTRIBUTE = Conventions.getQualifiedAttributeName( <ide> ScriptFactoryPostProcessor.class, "language"); <ide> <ide> public class ScriptFactoryPostProcessor extends InstantiationAwareBeanPostProces <ide> private static final String SCRIPTED_OBJECT_NAME_PREFIX = "scriptedObject."; <ide> <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> private long defaultRefreshCheckDelay = -1; <ide> public class ScriptFactoryPostProcessor extends InstantiationAwareBeanPostProces <ide> <ide> final DefaultListableBeanFactory scriptBeanFactory = new DefaultListableBeanFactory(); <ide> <del> /** Map from bean name String to ScriptSource object */ <add> /** Map from bean name String to ScriptSource object. */ <ide> private final Map<String, ScriptSource> scriptSourceCache = new HashMap<>(); <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java <ide> public ConcurrentModel addAttribute(String attributeName, @Nullable Object attri <ide> /** <ide> * Add the supplied attribute to this {@code Map} using a <ide> * {@link org.springframework.core.Conventions#getVariableName generated name}. <del> * <p><emphasis>Note: Empty {@link Collection Collections} are not added to <add> * <p><i>Note: Empty {@link Collection Collections} are not added to <ide> * the model when using this method because we cannot correctly determine <ide> * the true convention name. View code should check for {@code null} rather <del> * than for empty collections as is already done by JSTL tags.</emphasis> <add> * than for empty collections as is already done by JSTL tags.</i> <ide> * @param attributeValue the model attribute value (never {@code null} for {@code ConcurrentModel}, <ide> * with the {@code Nullable} declaration inherited from {@link Model#addAttribute(String, Object)}) <ide> */ <ide><path>spring-context/src/main/java/org/springframework/ui/Model.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public interface Model { <ide> /** <ide> * Add the supplied attribute to this {@code Map} using a <ide> * {@link org.springframework.core.Conventions#getVariableName generated name}. <del> * <p><emphasis>Note: Empty {@link java.util.Collection Collections} are not added to <add> * <p><i>Note: Empty {@link java.util.Collection Collections} are not added to <ide> * the model when using this method because we cannot correctly determine <ide> * the true convention name. View code should check for {@code null} rather <del> * than for empty collections as is already done by JSTL tags.</emphasis> <add> * than for empty collections as is already done by JSTL tags.</i> <ide> * @param attributeValue the model attribute value (never {@code null}) <ide> */ <ide> Model addAttribute(Object attributeValue); <ide><path>spring-context/src/main/java/org/springframework/ui/ModelMap.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public ModelMap addAttribute(String attributeName, @Nullable Object attributeVal <ide> /** <ide> * Add the supplied attribute to this {@code Map} using a <ide> * {@link org.springframework.core.Conventions#getVariableName generated name}. <del> * <p><emphasis>Note: Empty {@link Collection Collections} are not added to <add> * <p><i>Note: Empty {@link Collection Collections} are not added to <ide> * the model when using this method because we cannot correctly determine <ide> * the true convention name. View code should check for {@code null} rather <del> * than for empty collections as is already done by JSTL tags.</emphasis> <add> * than for empty collections as is already done by JSTL tags.</i> <ide> * @param attributeValue the model attribute value (never {@code null}) <ide> */ <ide> public ModelMap addAttribute(Object attributeValue) { <ide><path>spring-context/src/main/java/org/springframework/ui/context/support/ResourceBundleThemeSource.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class ResourceBundleThemeSource implements HierarchicalThemeSource, BeanC <ide> @Nullable <ide> private ClassLoader beanClassLoader; <ide> <del> /** Map from theme name to Theme instance */ <add> /** Map from theme name to Theme instance. */ <ide> private final Map<String, Theme> themeCache = new ConcurrentHashMap<>(); <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/validation/DataBinder.java <ide> */ <ide> public class DataBinder implements PropertyEditorRegistry, TypeConverter { <ide> <del> /** Default object name used for binding: "target" */ <add> /** Default object name used for binding: "target". */ <ide> public static final String DEFAULT_OBJECT_NAME = "target"; <ide> <del> /** Default limit for array and collection growing: 256 */ <add> /** Default limit for array and collection growing: 256. */ <ide> public static final int DEFAULT_AUTO_GROW_COLLECTION_LIMIT = 256; <ide> <ide> <ide><path>spring-context/src/main/java/org/springframework/validation/Errors.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> void rejectValue(@Nullable String field, String errorCode, <ide> <ide> /** <ide> * Get all errors, both global and field ones. <del> * @return List of {@link ObjectError} instances <add> * @return a list of {@link ObjectError} instances <ide> */ <ide> List<ObjectError> getAllErrors(); <ide> <ide> void rejectValue(@Nullable String field, String errorCode, <ide> <ide> /** <ide> * Get all global errors. <del> * @return List of ObjectError instances <add> * @return a list of {@link ObjectError} instances <ide> */ <ide> List<ObjectError> getGlobalErrors(); <ide> <ide><path>spring-core/src/main/java/org/springframework/core/AttributeAccessorSupport.java <ide> @SuppressWarnings("serial") <ide> public abstract class AttributeAccessorSupport implements AttributeAccessor, Serializable { <ide> <del> /** Map with String keys and Object values */ <add> /** Map with String keys and Object values. */ <ide> private final Map<String, Object> attributes = new LinkedHashMap<>(0); <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/core/Constants.java <ide> */ <ide> public class Constants { <ide> <del> /** The name of the introspected class */ <add> /** The name of the introspected class. */ <ide> private final String className; <ide> <del> /** Map from String field name to object value */ <add> /** Map from String field name to object value. */ <ide> private final Map<String, Object> fieldCache = new HashMap<>(); <ide> <ide> <ide> protected final Map<String, Object> getFieldCache() { <ide> * Return a constant value cast to a Number. <ide> * @param code the name of the field (never {@code null}) <ide> * @return the Number value <del> * @see #asObject <ide> * @throws ConstantException if the field name wasn't found <ide> * or if the type wasn't compatible with Number <add> * @see #asObject <ide> */ <ide> public Number asNumber(String code) throws ConstantException { <ide> Object obj = asObject(code); <ide> public Number asNumber(String code) throws ConstantException { <ide> * @param code the name of the field (never {@code null}) <ide> * @return the String value <ide> * Works even if it's not a string (invokes {@code toString()}). <del> * @see #asObject <ide> * @throws ConstantException if the field name wasn't found <add> * @see #asObject <ide> */ <ide> public String asString(String code) throws ConstantException { <ide> return asObject(code).toString(); <ide><path>spring-core/src/main/java/org/springframework/core/GenericTypeResolver.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class GenericTypeResolver { <ide> <del> /** Cache from Class to TypeVariable Map */ <add> /** Cache from Class to TypeVariable Map. */ <ide> @SuppressWarnings("rawtypes") <ide> private static final Map<Class<?>, Map<TypeVariable, Type>> typeVariableCache = new ConcurrentReferenceHashMap<>(); <ide> <ide><path>spring-core/src/main/java/org/springframework/core/MethodParameter.java <ide> public class MethodParameter { <ide> <ide> private int nestingLevel = 1; <ide> <del> /** Map from Integer level to Integer type index */ <add> /** Map from Integer level to Integer type index. */ <ide> @Nullable <ide> Map<Integer, Integer> typeIndexesPerLevel; <ide> <ide><path>spring-core/src/main/java/org/springframework/core/NamedInheritableThreadLocal.java <ide> /* <del> * Copyright 2002-2008 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Juergen Hoeller <ide> * @since 2.5.2 <add> * @param <T> the value type <ide> * @see NamedThreadLocal <ide> */ <ide> public class NamedInheritableThreadLocal<T> extends InheritableThreadLocal<T> { <ide><path>spring-core/src/main/java/org/springframework/core/NamedThreadLocal.java <ide> /* <del> * Copyright 2002-2008 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Juergen Hoeller <ide> * @since 2.5.2 <add> * @param <T> the value type <ide> * @see NamedInheritableThreadLocal <ide> */ <ide> public class NamedThreadLocal<T> extends ThreadLocal<T> { <ide><path>spring-core/src/main/java/org/springframework/core/NestedCheckedException.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class NestedCheckedException extends Exception { <ide> <del> /** Use serialVersionUID from Spring 1.2 for interoperability */ <add> /** Use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = 7100714597678207546L; <ide> <ide> static { <ide><path>spring-core/src/main/java/org/springframework/core/NestedRuntimeException.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class NestedRuntimeException extends RuntimeException { <ide> <del> /** Use serialVersionUID from Spring 1.2 for interoperability */ <add> /** Use serialVersionUID from Spring 1.2 for interoperability. */ <ide> private static final long serialVersionUID = 5439915454935047936L; <ide> <ide> static { <ide><path>spring-core/src/main/java/org/springframework/core/OverridingClassLoader.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class OverridingClassLoader extends DecoratingClassLoader { <ide> <del> /** Packages that are excluded by default */ <add> /** Packages that are excluded by default. */ <ide> public static final String[] DEFAULT_EXCLUDED_PACKAGES = new String[] <ide> {"java.", "javax.", "sun.", "oracle.", "javassist.", "org.aspectj.", "net.sf.cglib."}; <ide> <ide><path>spring-core/src/main/java/org/springframework/core/ParameterizedTypeReference.java <ide> * @author Arjen Poutsma <ide> * @author Rossen Stoyanchev <ide> * @since 3.2 <add> * @param <T> the referenced type <ide> * @see <a href="http://gafter.blogspot.nl/2006/12/super-type-tokens.html">Neal Gafter on Super Type Tokens</a> <ide> */ <ide> public abstract class ParameterizedTypeReference<T> { <ide><path>spring-core/src/main/java/org/springframework/core/ResolvableType.java <ide> * {@link #forMethodParameter(Method, int) method parameters}, <ide> * {@link #forMethodReturnType(Method) method returns} or <ide> * {@link #forClass(Class) classes}. Most methods on this class will themselves return <del> * {@link ResolvableType}s, allowing easy navigation. For example: <add> * {@link ResolvableType ResolvableTypes}, allowing easy navigation. For example: <ide> * <pre class="code"> <ide> * private HashMap&lt;Integer, List&lt;String&gt;&gt; myMap; <ide> * <ide> public ResolvableType getGeneric(@Nullable int... indexes) { <ide> } <ide> <ide> /** <del> * Return an array of {@link ResolvableType}s representing the generic parameters of <add> * Return an array of {@link ResolvableType ResolvableTypes} representing the generic parameters of <ide> * this type. If no generics are available an empty array is returned. If you need to <ide> * access a specific generic consider using the {@link #getGeneric(int...)} method as <ide> * it allows access to nested generics and protects against <ide> * {@code IndexOutOfBoundsExceptions}. <del> * @return an array of {@link ResolvableType}s representing the generic parameters <add> * @return an array of {@link ResolvableType ResolvableTypes} representing the generic parameters <ide> * (never {@code null}) <ide> * @see #hasGenerics() <ide> * @see #getGeneric(int...) <ide> public Class<?> resolveGeneric(int... indexes) { <ide> /** <ide> * Resolve this type to a {@link java.lang.Class}, returning {@code null} <ide> * if the type cannot be resolved. This method will consider bounds of <del> * {@link TypeVariable}s and {@link WildcardType}s if direct resolution fails; <add> * {@link TypeVariable TypeVariables} and {@link WildcardType WildcardTypes} if direct resolution fails; <ide> * however, bounds of {@code Object.class} will be ignored. <ide> * @return the resolved {@link Class}, or {@code null} if not resolvable <ide> * @see #resolve(Class) <ide> public Class<?> resolve() { <ide> /** <ide> * Resolve this type to a {@link java.lang.Class}, returning the specified <ide> * {@code fallback} if the type cannot be resolved. This method will consider bounds <del> * of {@link TypeVariable}s and {@link WildcardType}s if direct resolution fails; <add> * of {@link TypeVariable TypeVariables} and {@link WildcardType WildcardTypes} if direct resolution fails; <ide> * however, bounds of {@code Object.class} will be ignored. <ide> * @param fallback the fallback class to use if resolution fails <ide> * @return the resolved {@link Class} or the {@code fallback} <ide> public static void clearCache() { <ide> <ide> <ide> /** <del> * Strategy interface used to resolve {@link TypeVariable}s. <add> * Strategy interface used to resolve {@link TypeVariable TypeVariables}. <ide> */ <ide> interface VariableResolver extends Serializable { <ide> <ide> public String toString() { <ide> <ide> <ide> /** <del> * Internal helper to handle bounds from {@link WildcardType}s. <add> * Internal helper to handle bounds from {@link WildcardType WildcardTypes}. <ide> */ <ide> private static class WildcardBounds { <ide> <ide> enum Kind {UPPER, LOWER} <ide> } <ide> <ide> <add> /** <add> * Internal {@link Type} used to represent an empty value. <add> */ <ide> @SuppressWarnings("serial") <ide> static class EmptyType implements Type, Serializable { <ide> <ide><path>spring-core/src/main/java/org/springframework/core/SerializableTypeWrapper.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> <ide> /** <ide> * Internal utility class that can be used to obtain wrapped {@link Serializable} <del> * variants of {@link java.lang.reflect.Type}s. <add> * variants of {@link java.lang.reflect.Type java.lang.reflect.Types}. <ide> * <ide> * <p>{@link #forField(Field) Fields} or {@link #forMethodParameter(MethodParameter) <ide> * MethodParameters} can be used as the root source for a serializable type. <ide> * <p>The returned type will either be a {@link Class} or a serializable proxy of <ide> * {@link GenericArrayType}, {@link ParameterizedType}, {@link TypeVariable} or <ide> * {@link WildcardType}. With the exception of {@link Class} (which is final) calls <del> * to methods that return further {@link Type}s (for example <add> * to methods that return further {@link Type Types} (for example <ide> * {@link GenericArrayType#getGenericComponentType()}) will be automatically wrapped. <ide> * <ide> * @author Phillip Webb <ide> else if (Type[].class == method.getReturnType() && args == null) { <ide> <ide> <ide> /** <del> * {@link TypeProvider} for {@link Type}s obtained from a {@link Field}. <add> * {@link TypeProvider} for {@link Type Types} obtained from a {@link Field}. <ide> */ <ide> @SuppressWarnings("serial") <ide> static class FieldTypeProvider implements TypeProvider { <ide> private void readObject(ObjectInputStream inputStream) throws IOException, Class <ide> <ide> <ide> /** <del> * {@link TypeProvider} for {@link Type}s obtained from a {@link MethodParameter}. <add> * {@link TypeProvider} for {@link Type Types} obtained from a {@link MethodParameter}. <ide> */ <ide> @SuppressWarnings("serial") <ide> static class MethodParameterTypeProvider implements TypeProvider { <ide> private void readObject(ObjectInputStream inputStream) throws IOException, Class <ide> <ide> <ide> /** <del> * {@link TypeProvider} for {@link Type}s obtained by invoking a no-arg method. <add> * {@link TypeProvider} for {@link Type Types} obtained by invoking a no-arg method. <ide> */ <ide> @SuppressWarnings("serial") <ide> static class MethodInvokeTypeProvider implements TypeProvider { <ide><path>spring-core/src/main/java/org/springframework/core/SimpleAliasRegistry.java <ide> */ <ide> public class SimpleAliasRegistry implements AliasRegistry { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <del> /** Map from alias to canonical name */ <add> /** Map from alias to canonical name. */ <ide> private final Map<String, String> aliasMap = new ConcurrentHashMap<>(16); <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java <ide> public static <A extends Annotation> Set<A> getAllMergedAnnotations(AnnotatedEle <ide> * @param annotationType the annotation type to find (never {@code null}) <ide> * @return the set of all merged repeatable {@code Annotations} found, <ide> * or an empty set if none were found <add> * @throws IllegalArgumentException if the {@code element} or {@code annotationType} <ide> * @since 4.3 <ide> * @see #getMergedAnnotation(AnnotatedElement, Class) <ide> * @see #getAllMergedAnnotations(AnnotatedElement, Class) <ide> * @see #getMergedRepeatableAnnotations(AnnotatedElement, Class, Class) <del> * @throws IllegalArgumentException if the {@code element} or {@code annotationType} <ide> * is {@code null}, or if the container type cannot be resolved <ide> */ <ide> public static <A extends Annotation> Set<A> getMergedRepeatableAnnotations(AnnotatedElement element, <ide> public static <A extends Annotation> Set<A> getMergedRepeatableAnnotations(Annot <ide> * {@link java.lang.annotation.Repeatable} <ide> * @return the set of all merged repeatable {@code Annotations} found, <ide> * or an empty set if none were found <del> * @since 4.3 <del> * @see #getMergedAnnotation(AnnotatedElement, Class) <del> * @see #getAllMergedAnnotations(AnnotatedElement, Class) <ide> * @throws IllegalArgumentException if the {@code element} or {@code annotationType} <ide> * is {@code null}, or if the container type cannot be resolved <ide> * @throws AnnotationConfigurationException if the supplied {@code containerType} <ide> * is not a valid container annotation for the supplied {@code annotationType} <add> * @since 4.3 <add> * @see #getMergedAnnotation(AnnotatedElement, Class) <add> * @see #getAllMergedAnnotations(AnnotatedElement, Class) <ide> */ <ide> public static <A extends Annotation> Set<A> getMergedRepeatableAnnotations(AnnotatedElement element, <ide> Class<A> annotationType, @Nullable Class<? extends Annotation> containerType) { <ide> public static <A extends Annotation> Set<A> findAllMergedAnnotations(AnnotatedEl <ide> * @param annotationType the annotation type to find (never {@code null}) <ide> * @return the set of all merged repeatable {@code Annotations} found, <ide> * or an empty set if none were found <add> * @throws IllegalArgumentException if the {@code element} or {@code annotationType} <add> * is {@code null}, or if the container type cannot be resolved <ide> * @since 4.3 <ide> * @see #findMergedAnnotation(AnnotatedElement, Class) <ide> * @see #findAllMergedAnnotations(AnnotatedElement, Class) <ide> * @see #findMergedRepeatableAnnotations(AnnotatedElement, Class, Class) <del> * @throws IllegalArgumentException if the {@code element} or {@code annotationType} <del> * is {@code null}, or if the container type cannot be resolved <ide> */ <ide> public static <A extends Annotation> Set<A> findMergedRepeatableAnnotations(AnnotatedElement element, <ide> Class<A> annotationType) { <ide> public static <A extends Annotation> Set<A> findMergedRepeatableAnnotations(Anno <ide> * {@link java.lang.annotation.Repeatable} <ide> * @return the set of all merged repeatable {@code Annotations} found, <ide> * or an empty set if none were found <del> * @since 4.3 <del> * @see #findMergedAnnotation(AnnotatedElement, Class) <del> * @see #findAllMergedAnnotations(AnnotatedElement, Class) <ide> * @throws IllegalArgumentException if the {@code element} or {@code annotationType} <ide> * is {@code null}, or if the container type cannot be resolved <ide> * @throws AnnotationConfigurationException if the supplied {@code containerType} <ide> * is not a valid container annotation for the supplied {@code annotationType} <add> * @since 4.3 <add> * @see #findMergedAnnotation(AnnotatedElement, Class) <add> * @see #findAllMergedAnnotations(AnnotatedElement, Class) <ide> */ <ide> public static <A extends Annotation> Set<A> findMergedRepeatableAnnotations(AnnotatedElement element, <ide> Class<A> annotationType, @Nullable Class<? extends Annotation> containerType) { <ide> private static Class<? extends Annotation> resolveContainerType(Class<? extends <ide> * annotation for the supplied repeatable {@code annotationType} (i.e., <ide> * that it declares a {@code value} attribute that holds an array of the <ide> * {@code annotationType}). <del> * @since 4.3 <ide> * @throws AnnotationConfigurationException if the supplied {@code containerType} <ide> * is not a valid container annotation for the supplied {@code annotationType} <add> * @since 4.3 <ide> */ <ide> private static void validateContainerType(Class<? extends Annotation> annotationType, <ide> Class<? extends Annotation> containerType) { <ide> private static void validateContainerType(Class<? extends Annotation> annotation <ide> } <ide> } <ide> <del> /** <del> * @since 4.3 <del> */ <ide> private static <A extends Annotation> Set<A> postProcessAndSynthesizeAggregatedResults(AnnotatedElement element, <ide> Class<A> annotationType, List<AnnotationAttributes> aggregatedResults) { <ide> <ide><path>spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java <ide> static boolean isAttributeMethod(@Nullable Method method) { <ide> /** <ide> * Determine if the supplied method is an "annotationType" method. <ide> * @return {@code true} if the method is an "annotationType" method <del> * @see Annotation#annotationType() <ide> * @since 4.2 <add> * @see Annotation#annotationType() <ide> */ <ide> static boolean isAnnotationTypeMethod(@Nullable Method method) { <ide> return (method != null && method.getName().equals("annotationType") && method.getParameterCount() == 0); <ide><path>spring-core/src/main/java/org/springframework/core/codec/AbstractDataBufferDecoder.java <ide> * <ide> * @author Rossen Stoyanchev <ide> * @since 5.0 <add> * @param <T> the element type <ide> */ <ide> public abstract class AbstractDataBufferDecoder<T> extends AbstractDecoder<T> { <ide> <ide><path>spring-core/src/main/java/org/springframework/core/codec/AbstractDecoder.java <ide> * @author Sebastien Deleuze <ide> * @author Arjen Poutsma <ide> * @since 5.0 <add> * @param <T> the element type <ide> */ <ide> public abstract class AbstractDecoder<T> implements Decoder<T> { <ide> <ide><path>spring-core/src/main/java/org/springframework/core/codec/AbstractEncoder.java <ide> * @author Sebastien Deleuze <ide> * @author Arjen Poutsma <ide> * @since 5.0 <add> * @param <T> the element type <ide> */ <ide> public abstract class AbstractEncoder<T> implements Encoder<T> { <ide> <ide><path>spring-core/src/main/java/org/springframework/core/codec/AbstractSingleValueEncoder.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Arjen Poutsma <ide> * @since 5.0 <add> * @param <T> the element type <ide> */ <ide> public abstract class AbstractSingleValueEncoder<T> extends AbstractEncoder<T> { <ide> <ide> public final Flux<DataBuffer> encode(Publisher<? extends T> inputStream, DataBuf <ide> * @param dataBufferFactory a buffer factory used to create the output <ide> * @param type the stream element type to process <ide> * @param mimeType the mime type to process <del> * @param hints Additional information about how to do decode, optional <add> * @param hints additional information about how to do decode, optional <ide> * @return the output stream <ide> */ <ide> protected abstract Flux<DataBuffer> encode(T t, DataBufferFactory dataBufferFactory, <ide><path>spring-core/src/main/java/org/springframework/core/codec/ByteBufferDecoder.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.util.MimeTypeUtils; <ide> <ide> /** <del> * Decoder for {@link ByteBuffer}s. <add> * Decoder for {@link ByteBuffer ByteBuffers}. <ide> * <ide> * @author Sebastien Deleuze <ide> * @author Arjen Poutsma <ide><path>spring-core/src/main/java/org/springframework/core/codec/ByteBufferEncoder.java <ide> import org.springframework.util.MimeTypeUtils; <ide> <ide> /** <del> * Encoder for {@link ByteBuffer}s. <add> * Encoder for {@link ByteBuffer ByteBuffers}. <ide> * <ide> * @author Sebastien Deleuze <ide> * @since 5.0 <ide><path>spring-core/src/main/java/org/springframework/core/codec/CharSequenceEncoder.java <ide> */ <ide> public class CharSequenceEncoder extends AbstractEncoder<CharSequence> { <ide> <add> /** <add> * The default charset used by the encoder. <add> */ <ide> public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/core/codec/DataBufferDecoder.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.util.MimeTypeUtils; <ide> <ide> /** <del> * Simple pass-through decoder for {@link DataBuffer}s. <add> * Simple pass-through decoder for {@link DataBuffer DataBuffers}. <ide> * <p><strong>Note</strong> that the "decoded" buffers returned by instances of this class should <ide> * be released after usage by calling <ide> * {@link org.springframework.core.io.buffer.DataBufferUtils#release(DataBuffer)}. <ide><path>spring-core/src/main/java/org/springframework/core/codec/DataBufferEncoder.java <ide> import org.springframework.util.MimeTypeUtils; <ide> <ide> /** <del> * Simple pass-through encoder for {@link DataBuffer}s. <add> * Simple pass-through encoder for {@link DataBuffer DataBuffers}. <ide> * <ide> * @author Arjen Poutsma <ide> * @since 5.0 <ide><path>spring-core/src/main/java/org/springframework/core/codec/ResourceDecoder.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.util.MimeTypeUtils; <ide> <ide> /** <del> * Decoder for {@link Resource}s. <add> * Decoder for {@link Resource Resources}. <ide> * <ide> * @author Arjen Poutsma <ide> * @author Rossen Stoyanchev <ide><path>spring-core/src/main/java/org/springframework/core/codec/ResourceEncoder.java <ide> import org.springframework.util.StreamUtils; <ide> <ide> /** <del> * Encoder for {@link Resource}s. <add> * Encoder for {@link Resource Resources}. <ide> * <ide> * @author Arjen Poutsma <ide> * @since 5.0 <ide> */ <ide> public class ResourceEncoder extends AbstractSingleValueEncoder<Resource> { <ide> <add> /** <add> * The default buffer size used by the encoder. <add> */ <ide> public static final int DEFAULT_BUFFER_SIZE = StreamUtils.BUFFER_SIZE; <ide> <ide> private final int bufferSize; <ide><path>spring-core/src/main/java/org/springframework/core/codec/ResourceRegionEncoder.java <ide> import org.springframework.util.StreamUtils; <ide> <ide> /** <del> * Encoder for {@link ResourceRegion}s. <add> * Encoder for {@link ResourceRegion ResourceRegions}. <ide> * <ide> * @author Brian Clozel <ide> * @since 5.0 <ide> */ <ide> public class ResourceRegionEncoder extends AbstractEncoder<ResourceRegion> { <ide> <add> /** <add> * The default buffer size used by the encoder. <add> */ <ide> public static final int DEFAULT_BUFFER_SIZE = StreamUtils.BUFFER_SIZE; <ide> <add> /** <add> * The hint key that contains the boundary string. <add> */ <ide> public static final String BOUNDARY_STRING_HINT = ResourceRegionEncoder.class.getName() + ".boundaryString"; <ide> <ide> private final int bufferSize; <ide><path>spring-core/src/main/java/org/springframework/core/convert/converter/ConverterFactory.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Keith Donald <ide> * @since 3.0 <del> * @see ConditionalConverter <ide> * @param <S> the source type converters created by this factory can convert from <ide> * @param <R> the target range (or base) type converters created by this factory can convert to; <ide> * for example {@link Number} for a set of number subtypes. <add> * @see ConditionalConverter <ide> */ <ide> public interface ConverterFactory<S, R> { <ide> <ide><path>spring-core/src/main/java/org/springframework/core/convert/support/ByteBufferConverter.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.lang.Nullable; <ide> <ide> /** <del> * Converts a {@link ByteBuffer} directly to and from {@code byte[]}s and indirectly <add> * Converts a {@link ByteBuffer} directly to and from {@code byte[] ByteBuffer} directly to and from {@code byte[]s} and indirectly <ide> * to any type that the {@link ConversionService} support via {@code byte[]}. <ide> * <ide> * @author Phillip Webb <ide><path>spring-core/src/main/java/org/springframework/core/env/AbstractPropertyResolver.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public String resolveRequiredPlaceholders(String text) throws IllegalArgumentExc <ide> * unresolvable placeholders should raise an exception or be ignored. <ide> * <p>Invoked from {@link #getProperty} and its variants, implicitly resolving <ide> * nested placeholders. In contrast, {@link #resolvePlaceholders} and <del> * {@link #resolveRequiredPlaceholders} do <emphasis>not</emphasis> delegate <add> * {@link #resolveRequiredPlaceholders} do <i>not</i> delegate <ide> * to this method but rather perform their own handling of unresolvable <ide> * placeholders, as specified by each of those methods. <ide> * @since 3.2 <ide><path>spring-core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Chris Beams <ide> * @since 3.1 <add> * @param <T> the source type <ide> * @see PropertySource <ide> * @see SimpleCommandLinePropertySource <ide> * @see JOptCommandLinePropertySource <ide> */ <ide> public abstract class CommandLinePropertySource<T> extends EnumerablePropertySource<T> { <ide> <del> /** The default name given to {@link CommandLinePropertySource} instances: {@value} */ <add> /** The default name given to {@link CommandLinePropertySource} instances: {@value}. */ <ide> public static final String COMMAND_LINE_PROPERTY_SOURCE_NAME = "commandLineArgs"; <ide> <del> /** The default name of the property representing non-option arguments: {@value} */ <add> /** The default name of the property representing non-option arguments: {@value}. */ <ide> public static final String DEFAULT_NON_OPTION_ARGS_PROPERTY_NAME = "nonOptionArgs"; <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <pre class="code"> <ide> * ConfigurableEnvironment environment = new StandardEnvironment(); <ide> * MutablePropertySources propertySources = environment.getPropertySources(); <del> * Map<String, String> myMap = new HashMap<String, String>(); <add> * Map&lt;String, String&gt; myMap = new HashMap&lt;&gt;(); <ide> * myMap.put("xyz", "myValue"); <ide> * propertySources.addFirst(new MapPropertySource("MY_MAP", myMap)); <ide> * </pre> <ide> public interface ConfigurableEnvironment extends Environment, ConfigurableProper <ide> * <p>Any existing active profiles will be replaced with the given arguments; call <ide> * with zero arguments to clear the current set of active profiles. Use <ide> * {@link #addActiveProfile} to add a profile while preserving the existing set. <add> * @throws IllegalArgumentException if any profile is null, empty or whitespace-only <ide> * @see #addActiveProfile <ide> * @see #setDefaultProfiles <ide> * @see org.springframework.context.annotation.Profile <ide> * @see AbstractEnvironment#ACTIVE_PROFILES_PROPERTY_NAME <del> * @throws IllegalArgumentException if any profile is null, empty or whitespace-only <ide> */ <ide> void setActiveProfiles(String... profiles); <ide> <ide> /** <ide> * Add a profile to the current set of active profiles. <del> * @see #setActiveProfiles <ide> * @throws IllegalArgumentException if the profile is null, empty or whitespace-only <add> * @see #setActiveProfiles <ide> */ <ide> void addActiveProfile(String profile); <ide> <ide> /** <ide> * Specify the set of profiles to be made active by default if no other profiles <ide> * are explicitly made active through {@link #setActiveProfiles}. <del> * @see AbstractEnvironment#DEFAULT_PROFILES_PROPERTY_NAME <ide> * @throws IllegalArgumentException if any profile is null, empty or whitespace-only <add> * @see AbstractEnvironment#DEFAULT_PROFILES_PROPERTY_NAME <ide> */ <ide> void setDefaultProfiles(String... profiles); <ide> <ide><path>spring-core/src/main/java/org/springframework/core/env/EnumerablePropertySource.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Chris Beams <ide> * @author Juergen Hoeller <ide> * @since 3.1 <add> * @param <T> the source type <ide> */ <ide> public abstract class EnumerablePropertySource<T> extends PropertySource<T> { <ide> <ide><path>spring-core/src/main/java/org/springframework/core/env/PropertySource.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Chris Beams <ide> * @since 3.1 <add> * @param <T> the source type <ide> * @see PropertySources <ide> * @see PropertyResolver <ide> * @see PropertySourcesPropertyResolver <ide> public PropertySource(String name) { <ide> <ide> <ide> /** <del> * Return the name of this {@code PropertySource} <add> * Return the name of this {@code PropertySource}. <ide> */ <ide> public String getName() { <ide> return this.name; <ide> public String getProperty(String name) { <ide> <ide> <ide> /** <add> * A {@code PropertySource} implementation intended for collection comparison <add> * purposes. <add> * <ide> * @see PropertySource#named(String) <ide> */ <ide> static class ComparisonPropertySource extends StubPropertySource { <ide><path>spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public boolean containsKey(Object key) { <ide> } <ide> <ide> /** <add> * Returns the value to which the specified key is mapped, or {@code null} if this map <add> * contains no mapping for the key. <ide> * @param key the name of the system attribute to retrieve <ide> * @throws IllegalArgumentException if given key is non-String <ide> */ <ide><path>spring-core/src/main/java/org/springframework/core/env/StandardEnvironment.java <ide> /* <del> * Copyright 2002-2013 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class StandardEnvironment extends AbstractEnvironment { <ide> <del> /** System environment property source name: {@value} */ <add> /** System environment property source name: {@value}. */ <ide> public static final String SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME = "systemEnvironment"; <ide> <del> /** JVM system properties property source name: {@value} */ <add> /** JVM system properties property source name: {@value}. */ <ide> public static final String SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME = "systemProperties"; <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/core/io/PathResource.java <ide> public PathResource(String path) { <ide> * <p>Note: Unlike {@link FileSystemResource}, when building relative resources <ide> * via {@link #createRelative}, the relative path will be built <i>underneath</i> <ide> * the given root: e.g. Paths.get("C:/dir1/"), relative path "dir2" -> "C:/dir1/dir2"! <del> * @see java.nio.file.Paths#get(URI) <ide> * @param uri a path URI <add> * @see java.nio.file.Paths#get(URI) <ide> */ <ide> public PathResource(URI uri) { <ide> Assert.notNull(uri, "URI must not be null"); <ide><path>spring-core/src/main/java/org/springframework/core/io/ResourceLoader.java <ide> */ <ide> public interface ResourceLoader { <ide> <del> /** Pseudo URL prefix for loading from the class path: "classpath:" */ <add> /** Pseudo URL prefix for loading from the class path: "classpath:". */ <ide> String CLASSPATH_URL_PREFIX = ResourceUtils.CLASSPATH_URL_PREFIX; <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferFactory.java <ide> import java.util.List; <ide> <ide> /** <del> * A factory for {@link DataBuffer}s, allowing for allocation and wrapping of <add> * A factory for {@link DataBuffer DataBuffers}, allowing for allocation and wrapping of <ide> * data buffers. <ide> * <ide> * @author Arjen Poutsma <ide><path>spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java <ide> import org.springframework.util.Assert; <ide> <ide> /** <del> * Utility class for working with {@link DataBuffer}s. <add> * Utility class for working with {@link DataBuffer DataBuffers}. <ide> * <ide> * @author Arjen Poutsma <ide> * @author Brian Clozel <ide> public static Flux<DataBuffer> read( <ide> //--------------------------------------------------------------------- <ide> <ide> /** <del> * Write the given stream of {@link DataBuffer}s to the given {@code OutputStream}. Does <add> * Write the given stream of {@link DataBuffer DataBuffers} to the given {@code OutputStream}. Does <ide> * <strong>not</strong> close the output stream when the flux is terminated, and does <ide> * <strong>not</strong> {@linkplain #release(DataBuffer) release} the data buffers in the <ide> * source. If releasing is required, then subscribe to the returned {@code Flux} with a <ide> public static Flux<DataBuffer> write(Publisher<DataBuffer> source, OutputStream <ide> } <ide> <ide> /** <del> * Write the given stream of {@link DataBuffer}s to the given {@code WritableByteChannel}. Does <add> * Write the given stream of {@link DataBuffer DataBuffers} to the given {@code WritableByteChannel}. Does <ide> * <strong>not</strong> close the channel when the flux is terminated, and does <ide> * <strong>not</strong> {@linkplain #release(DataBuffer) release} the data buffers in the <ide> * source. If releasing is required, then subscribe to the returned {@code Flux} with a <ide> public static Flux<DataBuffer> write(Publisher<DataBuffer> source, WritableByteC <ide> } <ide> <ide> /** <del> * Write the given stream of {@link DataBuffer}s to the given {@code AsynchronousFileChannel}. <add> * Write the given stream of {@link DataBuffer DataBuffers} to the given {@code AsynchronousFileChannel}. <ide> * Does <strong>not</strong> close the channel when the flux is terminated, and does <ide> * <strong>not</strong> {@linkplain #release(DataBuffer) release} the data buffers in the <ide> * source. If releasing is required, then subscribe to the returned {@code Flux} with a <ide><path>spring-core/src/main/java/org/springframework/core/io/buffer/DefaultDataBuffer.java <ide> private void ensureCapacity(int length) { <ide> } <ide> <ide> /** <add> * Calculate the capacity of the buffer. <ide> * @see io.netty.buffer.AbstractByteBufAllocator#calculateNewCapacity(int, int) <ide> */ <ide> private int calculateCapacity(int neededCapacity) { <ide><path>spring-core/src/main/java/org/springframework/core/io/buffer/NettyDataBuffer.java <ide> public NettyDataBuffer write(ByteBuffer... buffers) { <ide> } <ide> <ide> /** <del> * Writes one or more Netty {@link ByteBuf}s to this buffer, starting at the current <add> * Writes one or more Netty {@link ByteBuf ByteBufs} to this buffer, starting at the current <ide> * writing position. <ide> * @param byteBufs the buffers to write into this buffer <ide> * @return this buffer <ide><path>spring-core/src/main/java/org/springframework/core/io/support/LocalizedResourceHelper.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class LocalizedResourceHelper { <ide> <del> /** The default separator to use inbetween file name parts: an underscore */ <add> /** The default separator to use inbetween file name parts: an underscore. */ <ide> public static final String DEFAULT_SEPARATOR = "_"; <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java <ide> * @author Colin Sampaleanu <ide> * @author Marius Bogoevici <ide> * @author Costin Leau <del> * @author Phil Webb <add> * @author Phillip Webb <ide> * @since 1.0.2 <ide> * @see #CLASSPATH_ALL_URL_PREFIX <ide> * @see org.springframework.util.AntPathMatcher <ide><path>spring-core/src/main/java/org/springframework/core/io/support/PropertiesLoaderSupport.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class PropertiesLoaderSupport { <ide> <del> /** Logger available to subclasses */ <add> /** Logger available to subclasses. */ <ide> protected final Log logger = LogFactory.getLog(getClass()); <ide> <ide> @Nullable <ide><path>spring-core/src/main/java/org/springframework/core/io/support/ResourcePropertySource.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class ResourcePropertySource extends PropertiesPropertySource { <ide> <del> /** The original resource name, if different from the given name */ <add> /** The original resource name, if different from the given name. */ <ide> @Nullable <ide> private final String resourceName; <ide> <ide><path>spring-core/src/main/java/org/springframework/core/io/support/ResourceRegion.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public ResourceRegion(Resource resource, long position, long count) { <ide> <ide> <ide> /** <del> * Return the underlying {@link Resource} for this {@code ResourceRegion} <add> * Return the underlying {@link Resource} for this {@code ResourceRegion}. <ide> */ <ide> public Resource getResource() { <ide> return this.resource; <ide> } <ide> <ide> /** <del> * Return the start position of this region in the underlying {@link Resource} <add> * Return the start position of this region in the underlying {@link Resource}. <ide> */ <ide> public long getPosition() { <ide> return this.position; <ide> } <ide> <ide> /** <del> * Return the byte count of this region in the underlying {@link Resource} <add> * Return the byte count of this region in the underlying {@link Resource}. <ide> */ <ide> public long getCount() { <ide> return this.count; <ide><path>spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java <ide> public abstract class SpringFactoriesLoader { <ide> * to obtain all registered factory names. <ide> * @param factoryClass the interface or abstract class representing the factory <ide> * @param classLoader the ClassLoader to use for loading (can be {@code null} to use the default) <del> * @see #loadFactoryNames <ide> * @throws IllegalArgumentException if any factory implementation class cannot <ide> * be loaded or if an error occurs while instantiating any factory <add> * @see #loadFactoryNames <ide> */ <ide> public static <T> List<T> loadFactories(Class<T> factoryClass, @Nullable ClassLoader classLoader) { <ide> Assert.notNull(factoryClass, "'factoryClass' must not be null"); <ide> public static <T> List<T> loadFactories(Class<T> factoryClass, @Nullable ClassLo <ide> * @param factoryClass the interface or abstract class representing the factory <ide> * @param classLoader the ClassLoader to use for loading resources; can be <ide> * {@code null} to use the default <del> * @see #loadFactories <ide> * @throws IllegalArgumentException if an error occurs while loading factory names <add> * @see #loadFactories <ide> */ <ide> public static List<String> loadFactoryNames(Class<?> factoryClass, @Nullable ClassLoader classLoader) { <ide> String factoryClassName = factoryClass.getName(); <ide><path>spring-core/src/main/java/org/springframework/core/serializer/Deserializer.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Gary Russell <ide> * @author Mark Fisher <ide> * @since 3.0.5 <add> * @param <T> the object type <ide> */ <ide> @FunctionalInterface <ide> public interface Deserializer<T> { <ide><path>spring-core/src/main/java/org/springframework/core/serializer/Serializer.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Gary Russell <ide> * @author Mark Fisher <ide> * @since 3.0.5 <add> * @param <T> the object type <ide> */ <ide> @FunctionalInterface <ide> public interface Serializer<T> { <ide><path>spring-core/src/main/java/org/springframework/core/style/ToStringCreator.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> private void printFieldSeparatorIfNecessary() { <ide> <ide> /** <ide> * Append the provided value. <del> * @param value The value to append <add> * @param value the value to append <ide> * @return this, to support call-chaining. <ide> */ <ide> public ToStringCreator append(Object value) { <ide><path>spring-core/src/main/java/org/springframework/core/task/AsyncListenableTaskExecutor.java <ide> /* <del> * Copyright 2002-2013 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> <ide> /** <ide> * Extension of the {@link AsyncTaskExecutor} interface, adding the capability to submit <del> * tasks for {@link ListenableFuture}s. <add> * tasks for {@link ListenableFuture ListenableFutures}. <ide> * <ide> * @author Arjen Poutsma <ide> * @since 4.0 <ide><path>spring-core/src/main/java/org/springframework/core/task/AsyncTaskExecutor.java <ide> /* <del> * Copyright 2002-2013 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public interface AsyncTaskExecutor extends TaskExecutor { <ide> <del> /** Constant that indicates immediate execution */ <add> /** Constant that indicates immediate execution. */ <ide> long TIMEOUT_IMMEDIATE = 0; <ide> <del> /** Constant that indicates no time limit */ <add> /** Constant that indicates no time limit. */ <ide> long TIMEOUT_INDEFINITE = Long.MAX_VALUE; <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator <ide> public static final int NO_CONCURRENCY = ConcurrencyThrottleSupport.NO_CONCURRENCY; <ide> <ide> <del> /** Internal concurrency throttle used by this executor */ <add> /** Internal concurrency throttle used by this executor. */ <ide> private final ConcurrencyThrottleAdapter concurrencyThrottle = new ConcurrencyThrottleAdapter(); <ide> <ide> @Nullable <ide><path>spring-core/src/main/java/org/springframework/core/type/classreading/AbstractRecursiveAnnotationVisitor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.util.ReflectionUtils; <ide> <ide> /** <add> * {@link AnnotationVisitor} to recursively visit annotations. <add> * <ide> * @author Chris Beams <ide> * @author Juergen Hoeller <ide> * @author Phillip Webb <ide><path>spring-core/src/main/java/org/springframework/core/type/classreading/CachingMetadataReaderFactory.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public class CachingMetadataReaderFactory extends SimpleMetadataReaderFactory { <ide> <del> /** Default maximum number of entries for a local MetadataReader cache: 256 */ <add> /** Default maximum number of entries for a local MetadataReader cache: 256. */ <ide> public static final int DEFAULT_CACHE_LIMIT = 256; <ide> <del> /** MetadataReader cache: either local or shared at the ResourceLoader level */ <add> /** MetadataReader cache: either local or shared at the ResourceLoader level. */ <ide> @Nullable <ide> private Map<Resource, MetadataReader> metadataReaderCache; <ide> <ide><path>spring-core/src/main/java/org/springframework/core/type/classreading/RecursiveAnnotationArrayVisitor.java <ide> import org.springframework.util.ObjectUtils; <ide> <ide> /** <add> * {@link AnnotationVisitor} to recursively visit annotation arrays. <add> * <ide> * @author Chris Beams <ide> * @author Juergen Hoeller <ide> * @since 3.1.1 <ide><path>spring-core/src/main/java/org/springframework/core/type/classreading/RecursiveAnnotationAttributesVisitor.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> <ide> package org.springframework.core.type.classreading; <ide> <add>import org.springframework.asm.AnnotationVisitor; <ide> import org.springframework.core.annotation.AnnotationAttributes; <ide> import org.springframework.core.annotation.AnnotationUtils; <ide> import org.springframework.lang.Nullable; <ide> <ide> /** <add> * {@link AnnotationVisitor} to recursively visit annotation attributes. <add> * <ide> * @author Chris Beams <ide> * @author Juergen Hoeller <ide> * @since 3.1.1 <ide><path>spring-core/src/main/java/org/springframework/util/AntPathMatcher.java <ide> */ <ide> public class AntPathMatcher implements PathMatcher { <ide> <del> /** Default path separator: "/" */ <add> /** Default path separator: "/". */ <ide> public static final String DEFAULT_PATH_SEPARATOR = "/"; <ide> <ide> private static final int CACHE_TURNOFF_THRESHOLD = 65536; <ide><path>spring-core/src/main/java/org/springframework/util/Assert.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public static void state(boolean expression, Supplier<String> messageSupplier) { <ide> } <ide> <ide> /** <add> * Assert a boolean expression, throwing an {@code IllegalStateException} <add> * if the expression evaluates to {@code false}. <ide> * @deprecated as of 4.3.7, in favor of {@link #state(boolean, String)} <ide> */ <ide> @Deprecated <ide> public static void isTrue(boolean expression, Supplier<String> messageSupplier) <ide> } <ide> <ide> /** <add> * Assert a boolean expression, throwing an {@code IllegalArgumentException} <add> * if the expression evaluates to {@code false}. <ide> * @deprecated as of 4.3.7, in favor of {@link #isTrue(boolean, String)} <ide> */ <ide> @Deprecated <ide> public static void isNull(@Nullable Object object, Supplier<String> messageSuppl <ide> } <ide> <ide> /** <add> * Assert that an object is {@code null}. <ide> * @deprecated as of 4.3.7, in favor of {@link #isNull(Object, String)} <ide> */ <ide> @Deprecated <ide> public static void notNull(@Nullable Object object, Supplier<String> messageSupp <ide> } <ide> <ide> /** <add> * Assert that an object is not {@code null}. <ide> * @deprecated as of 4.3.7, in favor of {@link #notNull(Object, String)} <ide> */ <ide> @Deprecated <ide> public static void notNull(@Nullable Object object) { <ide> * <pre class="code">Assert.hasLength(name, "Name must not be empty");</pre> <ide> * @param text the String to check <ide> * @param message the exception message to use if the assertion fails <del> * @see StringUtils#hasLength <ide> * @throws IllegalArgumentException if the text is empty <add> * @see StringUtils#hasLength <ide> */ <ide> public static void hasLength(@Nullable String text, String message) { <ide> if (!StringUtils.hasLength(text)) { <ide> public static void hasLength(@Nullable String text, String message) { <ide> * @param text the String to check <ide> * @param messageSupplier a supplier for the exception message to use if the <ide> * assertion fails <del> * @see StringUtils#hasLength <ide> * @throws IllegalArgumentException if the text is empty <ide> * @since 5.0 <add> * @see StringUtils#hasLength <ide> */ <ide> public static void hasLength(@Nullable String text, Supplier<String> messageSupplier) { <ide> if (!StringUtils.hasLength(text)) { <ide> public static void hasLength(@Nullable String text, Supplier<String> messageSupp <ide> } <ide> <ide> /** <add> * Assert that the given String is not empty; that is, <add> * it must not be {@code null} and not the empty String. <ide> * @deprecated as of 4.3.7, in favor of {@link #hasLength(String, String)} <ide> */ <ide> @Deprecated <ide> public static void hasLength(@Nullable String text) { <ide> * <pre class="code">Assert.hasText(name, "'name' must not be empty");</pre> <ide> * @param text the String to check <ide> * @param message the exception message to use if the assertion fails <del> * @see StringUtils#hasText <ide> * @throws IllegalArgumentException if the text does not contain valid text content <add> * @see StringUtils#hasText <ide> */ <ide> public static void hasText(@Nullable String text, String message) { <ide> if (!StringUtils.hasText(text)) { <ide> public static void hasText(@Nullable String text, String message) { <ide> * @param text the String to check <ide> * @param messageSupplier a supplier for the exception message to use if the <ide> * assertion fails <del> * @see StringUtils#hasText <ide> * @throws IllegalArgumentException if the text does not contain valid text content <ide> * @since 5.0 <add> * @see StringUtils#hasText <ide> */ <ide> public static void hasText(@Nullable String text, Supplier<String> messageSupplier) { <ide> if (!StringUtils.hasText(text)) { <ide> public static void hasText(@Nullable String text, Supplier<String> messageSuppli <ide> } <ide> <ide> /** <add> * Assert that the given String contains valid text content; that is, it must not <add> * be {@code null} and must contain at least one non-whitespace character. <ide> * @deprecated as of 4.3.7, in favor of {@link #hasText(String, String)} <ide> */ <ide> @Deprecated <ide> public static void doesNotContain(@Nullable String textToSearch, String substrin <ide> } <ide> <ide> /** <add> * Assert that the given text does not contain the given substring. <ide> * @deprecated as of 4.3.7, in favor of {@link #doesNotContain(String, String, String)} <ide> */ <ide> @Deprecated <ide> public static void notEmpty(@Nullable Object[] array, Supplier<String> messageSu <ide> } <ide> <ide> /** <add> * Assert that an array contains elements; that is, it must not be <add> * {@code null} and must contain at least one element. <ide> * @deprecated as of 4.3.7, in favor of {@link #notEmpty(Object[], String)} <ide> */ <ide> @Deprecated <ide> public static void noNullElements(@Nullable Object[] array, Supplier<String> mes <ide> } <ide> <ide> /** <add> * Assert that an array contains no {@code null} elements. <ide> * @deprecated as of 4.3.7, in favor of {@link #noNullElements(Object[], String)} <ide> */ <ide> @Deprecated <ide> public static void notEmpty(@Nullable Collection<?> collection, Supplier<String> <ide> } <ide> <ide> /** <add> * Assert that a collection contains elements; that is, it must not be <add> * {@code null} and must contain at least one element. <ide> * @deprecated as of 4.3.7, in favor of {@link #notEmpty(Collection, String)} <ide> */ <ide> @Deprecated <ide> public static void notEmpty(@Nullable Map<?, ?> map, Supplier<String> messageSup <ide> } <ide> <ide> /** <add> * Assert that a Map contains entries; that is, it must not be {@code null} <add> * and must contain at least one entry. <ide> * @deprecated as of 4.3.7, in favor of {@link #notEmpty(Map, String)} <ide> */ <ide> @Deprecated <ide><path>spring-core/src/main/java/org/springframework/util/AutoPopulatingList.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Rob Harrop <ide> * @author Juergen Hoeller <ide> * @since 2.0 <add> * @param <E> the element type <ide> */ <ide> @SuppressWarnings("serial") <ide> public class AutoPopulatingList<E> implements List<E>, Serializable { <ide> public int hashCode() { <ide> /** <ide> * Factory interface for creating elements for an index-based access <ide> * data structure such as a {@link java.util.List}. <add> * <add> * @param <E> the element type <ide> */ <ide> @FunctionalInterface <ide> public interface ElementFactory<E> { <ide><path>spring-core/src/main/java/org/springframework/util/ClassUtils.java <ide> */ <ide> public abstract class ClassUtils { <ide> <del> /** Suffix for array class names: "[]" */ <add> /** Suffix for array class names: {@code "[]"}. */ <ide> public static final String ARRAY_SUFFIX = "[]"; <ide> <del> /** Prefix for internal array class names: "[" */ <add> /** Prefix for internal array class names: {@code "["}. */ <ide> private static final String INTERNAL_ARRAY_PREFIX = "["; <ide> <del> /** Prefix for internal non-primitive array class names: "[L" */ <add> /** Prefix for internal non-primitive array class names: {@code "[L"}. */ <ide> private static final String NON_PRIMITIVE_ARRAY_PREFIX = "[L"; <ide> <del> /** The package separator character: '.' */ <add> /** The package separator character: {@code '.'}. */ <ide> private static final char PACKAGE_SEPARATOR = '.'; <ide> <del> /** The path separator character: '/' */ <add> /** The path separator character: {@code '/'}. */ <ide> private static final char PATH_SEPARATOR = '/'; <ide> <del> /** The inner class separator character: '$' */ <add> /** The inner class separator character: {@code '$'}. */ <ide> private static final char INNER_CLASS_SEPARATOR = '$'; <ide> <del> /** The CGLIB class separator: "$$" */ <add> /** The CGLIB class separator: {@code "$$"}. */ <ide> public static final String CGLIB_CLASS_SEPARATOR = "$$"; <ide> <del> /** The ".class" file suffix */ <add> /** The ".class" file suffix. */ <ide> public static final String CLASS_FILE_SUFFIX = ".class"; <ide> <ide> <ide> public static ClassLoader overrideThreadContextClassLoader(@Nullable ClassLoader <ide> * @param name the name of the Class <ide> * @param classLoader the class loader to use <ide> * (may be {@code null}, which indicates the default class loader) <del> * @return Class instance for the supplied name <add> * @return a class instance for the supplied name <ide> * @throws ClassNotFoundException if the class was not found <ide> * @throws LinkageError if the class file could not be loaded <ide> * @see Class#forName(String, boolean, ClassLoader) <ide> public static Class<?> forName(String name, @Nullable ClassLoader classLoader) <ide> * @param className the name of the Class <ide> * @param classLoader the class loader to use <ide> * (may be {@code null}, which indicates the default class loader) <del> * @return Class instance for the supplied name <add> * @return a class instance for the supplied name <ide> * @throws IllegalArgumentException if the class name was not resolvable <ide> * (that is, the class could not be found or the class file could not be loaded) <ide> * @see #forName(String, ClassLoader) <ide><path>spring-core/src/main/java/org/springframework/util/CompositeIterator.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Erwin Vervaet <ide> * @author Juergen Hoeller <ide> * @since 3.0 <add> * @param <E> the element type <ide> */ <ide> public class CompositeIterator<E> implements Iterator<E> { <ide> <ide><path>spring-core/src/main/java/org/springframework/util/ConcurrencyThrottleSupport.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public abstract class ConcurrencyThrottleSupport implements Serializable { <ide> public static final int NO_CONCURRENCY = 0; <ide> <ide> <del> /** Transient to optimize serialization */ <add> /** Transient to optimize serialization. */ <ide> protected transient Log logger = LogFactory.getLog(getClass()); <ide> <ide> private transient Object monitor = new Object(); <ide><path>spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java <ide> protected static int calculateShift(int minimumValue, int maximumValue) { <ide> */ <ide> public enum ReferenceType { <ide> <del> /** Use {@link SoftReference}s */ <add> /** Use {@link SoftReference SoftReferences}. */ <ide> SOFT, <ide> <del> /** Use {@link WeakReference}s */ <add> /** Use {@link WeakReference WeakReferences}. */ <ide> WEAK <ide> } <ide> <ide> public final int getCount() { <ide> /** <ide> * A reference to an {@link Entry} contained in the map. Implementations are usually <ide> * wrappers around specific Java reference implementations (e.g., {@link SoftReference}). <add> * <add> * @param <K> the key type <add> * @param <V> the value type <ide> */ <ide> protected interface Reference<K, V> { <ide> <ide> public final int getCount() { <ide> <ide> /** <ide> * A single map entry. <add> * <add> * @param <K> the key type <add> * @param <V> the value type <ide> */ <ide> protected static final class Entry<K, V> implements Map.Entry<K, V> { <ide> <ide> protected enum Restructure { <ide> <ide> <ide> /** <del> * Strategy class used to manage {@link Reference}s. This class can be overridden if <add> * Strategy class used to manage {@link Reference References}. This class can be overridden if <ide> * alternative reference types need to be supported. <ide> */ <ide> protected class ReferenceManager { <ide> public Reference<K, V> pollForPurge() { <ide> <ide> <ide> /** <del> * Internal {@link Reference} implementation for {@link SoftReference}s. <add> * Internal {@link Reference} implementation for {@link SoftReference Reference} implementation for {@link SoftReferences}. <ide> */ <ide> private static final class SoftEntryReference<K, V> extends SoftReference<Entry<K, V>> implements Reference<K, V> { <ide> <ide> public void release() { <ide> <ide> <ide> /** <del> * Internal {@link Reference} implementation for {@link WeakReference}s. <add> * Internal {@link Reference} implementation for {@link WeakReference Reference} implementation for {@link WeakReferences}. <ide> */ <ide> private static final class WeakEntryReference<K, V> extends WeakReference<Entry<K, V>> implements Reference<K, V> { <ide> <ide><path>spring-core/src/main/java/org/springframework/util/FastByteArrayOutputStream.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public int available() { <ide> <ide> /** <ide> * Update the message digest with the remaining bytes in this stream. <del> * @param messageDigest The message digest to update <add> * @param messageDigest the message digest to update <ide> */ <ide> @Override <ide> public void updateMessageDigest(MessageDigest messageDigest) { <ide> public void updateMessageDigest(MessageDigest messageDigest) { <ide> /** <ide> * Update the message digest with the next len bytes in this stream. <ide> * Avoids creating new byte arrays and use internal buffers for performance. <del> * @param messageDigest The message digest to update <add> * @param messageDigest the message digest to update <ide> * @param len how many bytes to read from this stream and use to update the message digest <ide> */ <ide> @Override <ide><path>spring-core/src/main/java/org/springframework/util/FileCopyUtils.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class FileCopyUtils { <ide> <add> /** <add> * The default buffer size used when copying bytes. <add> */ <ide> public static final int BUFFER_SIZE = StreamUtils.BUFFER_SIZE; <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/util/InstanceFilter.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Stephane Nicoll <ide> * @since 4.1 <add> * @param <T> the instance type <ide> */ <ide> public class InstanceFilter<T> { <ide> <ide><path>spring-core/src/main/java/org/springframework/util/LinkedCaseInsensitiveMap.java <ide> * <ide> * @author Juergen Hoeller <ide> * @since 3.0 <add> * @param <V> the value type <ide> */ <ide> @SuppressWarnings("serial") <ide> public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable, Cloneable { <ide><path>spring-core/src/main/java/org/springframework/util/LinkedMultiValueMap.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * @author Arjen Poutsma <ide> * @author Juergen Hoeller <ide> * @since 3.0 <add> * @param <K> the key type <add> * @param <V> the value element type <ide> */ <ide> public class LinkedMultiValueMap<K, V> implements MultiValueMap<K, V>, Serializable, Cloneable { <ide> <ide> public void setAll(Map<K, V> values) { <ide> public Map<K, V> toSingleValueMap() { <ide> LinkedHashMap<K, V> singleValueMap = new LinkedHashMap<>(this.targetMap.size()); <ide> this.targetMap.forEach((key, value) -> singleValueMap.put(key, value.get(0))); <del> <add> <ide> return singleValueMap; <ide> } <ide> <ide><path>spring-core/src/main/java/org/springframework/util/MethodInvoker.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public class MethodInvoker { <ide> @Nullable <ide> private Object[] arguments; <ide> <del> /** The method we will call */ <add> /** The method we will call. */ <ide> @Nullable <ide> private Method methodObject; <ide> <ide><path>spring-core/src/main/java/org/springframework/util/MimeType.java <ide> public boolean equals(Object other) { <ide> /** <ide> * Determine if the parameters in this {@code MimeType} and the supplied <ide> * {@code MimeType} are equal, performing case-insensitive comparisons <del> * for {@link Charset}s. <add> * for {@link Charset Charsets}. <ide> * @since 4.2 <ide> */ <ide> private boolean parametersAreEqual(MimeType other) { <ide> private static Map<String, String> addCharsetParameter(Charset charset, Map<Stri <ide> } <ide> <ide> <add> /** <add> * Comparator to sort {@link MimeType MimeTypes} in order of specificity. <add> * <add> * @param <T> the type of mime types that may be compared by this comparator <add> */ <ide> public static class SpecificityComparator<T extends MimeType> implements Comparator<T> { <ide> <ide> @Override <ide><path>spring-core/src/main/java/org/springframework/util/MultiValueMap.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Arjen Poutsma <ide> * @since 3.0 <add> * @param <K> the key type <add> * @param <V> the value element type <ide> */ <ide> public interface MultiValueMap<K, V> extends Map<K, List<V>> { <ide> <ide><path>spring-core/src/main/java/org/springframework/util/ReflectionUtils.java <ide> public static <T> Constructor<T> accessibleConstructor(Class<T> clazz, Class<?>. <ide> * on Java 8 based interfaces that the given class implements). <ide> * @param clazz the class to introspect <ide> * @param mc the callback to invoke for each method <del> * @since 4.2 <ide> * @throws IllegalStateException if introspection fails <add> * @since 4.2 <ide> * @see #doWithMethods <ide> */ <ide> public static void doWithLocalMethods(Class<?> clazz, MethodCallback mc) { <ide> private static List<Method> findConcreteMethodsOnInterfaces(Class<?> clazz) { <ide> * Invoke the given callback on all locally declared fields in the given class. <ide> * @param clazz the target class to analyze <ide> * @param fc the callback to invoke for each field <del> * @since 4.2 <ide> * @throws IllegalStateException if introspection fails <add> * @since 4.2 <ide> * @see #doWithFields <ide> */ <ide> public static void doWithLocalFields(Class<?> clazz, FieldCallback fc) { <ide><path>spring-core/src/main/java/org/springframework/util/ResourceUtils.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class ResourceUtils { <ide> <del> /** Pseudo URL prefix for loading from the class path: "classpath:" */ <add> /** Pseudo URL prefix for loading from the class path: "classpath:". */ <ide> public static final String CLASSPATH_URL_PREFIX = "classpath:"; <ide> <del> /** URL prefix for loading from the file system: "file:" */ <add> /** URL prefix for loading from the file system: "file:". */ <ide> public static final String FILE_URL_PREFIX = "file:"; <ide> <del> /** URL prefix for loading from a jar file: "jar:" */ <add> /** URL prefix for loading from a jar file: "jar:". */ <ide> public static final String JAR_URL_PREFIX = "jar:"; <ide> <del> /** URL prefix for loading from a war file on Tomcat: "war:" */ <add> /** URL prefix for loading from a war file on Tomcat: "war:". */ <ide> public static final String WAR_URL_PREFIX = "war:"; <ide> <del> /** URL protocol for a file in the file system: "file" */ <add> /** URL protocol for a file in the file system: "file". */ <ide> public static final String URL_PROTOCOL_FILE = "file"; <ide> <del> /** URL protocol for an entry from a jar file: "jar" */ <add> /** URL protocol for an entry from a jar file: "jar". */ <ide> public static final String URL_PROTOCOL_JAR = "jar"; <ide> <del> /** URL protocol for an entry from a war file: "war" */ <add> /** URL protocol for an entry from a war file: "war". */ <ide> public static final String URL_PROTOCOL_WAR = "war"; <ide> <del> /** URL protocol for an entry from a zip file: "zip" */ <add> /** URL protocol for an entry from a zip file: "zip". */ <ide> public static final String URL_PROTOCOL_ZIP = "zip"; <ide> <del> /** URL protocol for an entry from a WebSphere jar file: "wsjar" */ <add> /** URL protocol for an entry from a WebSphere jar file: "wsjar". */ <ide> public static final String URL_PROTOCOL_WSJAR = "wsjar"; <ide> <del> /** URL protocol for an entry from a JBoss jar file: "vfszip" */ <add> /** URL protocol for an entry from a JBoss jar file: "vfszip". */ <ide> public static final String URL_PROTOCOL_VFSZIP = "vfszip"; <ide> <del> /** URL protocol for a JBoss file system resource: "vfsfile" */ <add> /** URL protocol for a JBoss file system resource: "vfsfile". */ <ide> public static final String URL_PROTOCOL_VFSFILE = "vfsfile"; <ide> <del> /** URL protocol for a general JBoss VFS resource: "vfs" */ <add> /** URL protocol for a general JBoss VFS resource: "vfs". */ <ide> public static final String URL_PROTOCOL_VFS = "vfs"; <ide> <del> /** File extension for a regular jar file: ".jar" */ <add> /** File extension for a regular jar file: ".jar". */ <ide> public static final String JAR_FILE_EXTENSION = ".jar"; <ide> <del> /** Separator between JAR URL and file path within the JAR: "!/" */ <add> /** Separator between JAR URL and file path within the JAR: "!/". */ <ide> public static final String JAR_URL_SEPARATOR = "!/"; <ide> <del> /** Special separator between WAR URL and jar part on Tomcat */ <add> /** Special separator between WAR URL and jar part on Tomcat. */ <ide> public static final String WAR_URL_SEPARATOR = "*/"; <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/util/StopWatch.java <ide> public class StopWatch { <ide> <ide> private final List<TaskInfo> taskList = new LinkedList<>(); <ide> <del> /** Start time of the current task */ <add> /** Start time of the current task. */ <ide> private long startTimeMillis; <ide> <del> /** Name of the current task */ <add> /** Name of the current task. */ <ide> @Nullable <ide> private String currentTaskName; <ide> <ide> public class StopWatch { <ide> <ide> private int taskCount; <ide> <del> /** Total running time */ <add> /** Total running time. */ <ide> private long totalTimeMillis; <ide> <ide> <ide><path>spring-core/src/main/java/org/springframework/util/StreamUtils.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class StreamUtils { <ide> <add> /** <add> * The default buffer size used why copying bytes. <add> */ <ide> public static final int BUFFER_SIZE = 4096; <ide> <ide> private static final byte[] EMPTY_CONTENT = new byte[0]; <ide><path>spring-core/src/main/java/org/springframework/util/SystemPropertyUtils.java <ide> /* <del> * Copyright 2002-2013 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> */ <ide> public abstract class SystemPropertyUtils { <ide> <del> /** Prefix for system property placeholders: "${" */ <add> /** Prefix for system property placeholders: "${". */ <ide> public static final String PLACEHOLDER_PREFIX = "${"; <ide> <del> /** Suffix for system property placeholders: "}" */ <add> /** Suffix for system property placeholders: "}". */ <ide> public static final String PLACEHOLDER_SUFFIX = "}"; <ide> <del> /** Value separator for system property placeholders: ":" */ <add> /** Value separator for system property placeholders: ":". */ <ide> public static final String VALUE_SEPARATOR = ":"; <ide> <ide> <ide> public abstract class SystemPropertyUtils { <ide> * corresponding system property values. <ide> * @param text the String to resolve <ide> * @return the resolved String <add> * @throws IllegalArgumentException if there is an unresolvable placeholder <ide> * @see #PLACEHOLDER_PREFIX <ide> * @see #PLACEHOLDER_SUFFIX <del> * @throws IllegalArgumentException if there is an unresolvable placeholder <ide> */ <ide> public static String resolvePlaceholders(String text) { <ide> return resolvePlaceholders(text, false); <ide> public static String resolvePlaceholders(String text) { <ide> * @param text the String to resolve <ide> * @param ignoreUnresolvablePlaceholders whether unresolved placeholders are to be ignored <ide> * @return the resolved String <add> * @throws IllegalArgumentException if there is an unresolvable placeholder <ide> * @see #PLACEHOLDER_PREFIX <ide> * @see #PLACEHOLDER_SUFFIX <del> * @throws IllegalArgumentException if there is an unresolvable placeholder <ide> * and the "ignoreUnresolvablePlaceholders" flag is {@code false} <ide> */ <ide> public static String resolvePlaceholders(String text, boolean ignoreUnresolvablePlaceholders) { <ide><path>spring-core/src/main/java/org/springframework/util/comparator/ComparableComparator.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2018 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * <ide> * @author Keith Donald <ide> * @since 1.2.2 <add> * @param <T> the type of comparable objects that may be compared by this comparator <ide> * @see Comparable <ide> */ <ide> public class ComparableComparator<T extends Comparable<T>> implements Comparator<T> { <ide> <ide> /** <del> * A shared instance of this default comparator <add> * A shared instance of this default comparator. <ide> * @see Comparators#comparable() <ide> */ <ide> @SuppressWarnings("rawtypes")
300
Ruby
Ruby
use bind values for join columns
4bc2ae0da1dd812aee759f6d13ad428354cd0e13
<ide><path>activerecord/lib/active_record/associations/association_scope.rb <ide> def scope <ide> <ide> private <ide> <add> def column_for(table_name, column_name) <add> columns = alias_tracker.connection.schema_cache.columns_hash[table_name] <add> columns[column_name] <add> end <add> <add> def bind(scope, column, value) <add> substitute = alias_tracker.connection.substitute_at( <add> column, scope.bind_values.length) <add> scope.bind_values += [[column, value]] <add> substitute <add> end <add> <ide> def add_constraints(scope) <ide> tables = construct_tables <ide> <ide> def add_constraints(scope) <ide> conditions = self.conditions[i] <ide> <ide> if reflection == chain.last <del> scope = scope.where(table[key].eq(owner[foreign_key])) <add> column = column_for(table.table_name, key.to_s) <add> bind_val = bind(scope, column, owner[foreign_key]) <add> scope = scope.where(table[key].eq(bind_val)) <add> #scope = scope.where(table[key].eq(owner[foreign_key])) <ide> <ide> if reflection.type <ide> scope = scope.where(table[reflection.type].eq(owner.class.base_class.name)) <ide><path>activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb <ide> def select_all(arel, name = nil, binds = []) <ide> <ide> # Returns a record hash with the column names as keys and column values <ide> # as values. <del> def select_one(arel, name = nil) <del> result = select_all(arel, name) <add> def select_one(arel, name = nil, binds = []) <add> result = select_all(arel, name, binds) <ide> result.first if result <ide> end <ide> <ide> # Returns a single value from a record <del> def select_value(arel, name = nil) <del> if result = select_one(arel, name) <add> def select_value(arel, name = nil, binds = []) <add> if result = select_one(arel, name, binds) <ide> result.values.first <ide> end <ide> end <ide><path>activerecord/lib/active_record/relation.rb <ide> def where_values_hash <ide> node.left.relation.name == table_name <ide> } <ide> <del> Hash[equalities.map { |where| [where.left.name, where.right] }] <add> binds = Hash[bind_values.find_all(&:first).map { |column, v| [column.name, v] }] <add> <add> Hash[equalities.map { |where| <add> name = where.left.name <add> [name, binds.fetch(name.to_s) { where.right }] <add> }] <ide> end <ide> <ide> def scope_for_create <ide><path>activerecord/lib/active_record/relation/calculations.rb <ide> def pluck(column_name) <ide> column_name = "#{table_name}.#{column_name}" <ide> end <ide> <del> result = klass.connection.select_all(select(column_name).arel) <add> result = klass.connection.select_all(select(column_name).arel, nil, bind_values) <ide> types = result.column_types.merge klass.column_types <ide> column = types[key] <ide> <ide> def execute_simple_calculation(operation, column_name, distinct) #:nodoc: <ide> query_builder = relation.arel <ide> end <ide> <del> type_cast_calculated_value(@klass.connection.select_value(query_builder), column_for(column_name), operation) <add> result = @klass.connection.select_value(query_builder, nil, relation.bind_values) <add> type_cast_calculated_value(result, column_for(column_name), operation) <ide> end <ide> <ide> def execute_grouped_calculation(operation, column_name, distinct) #:nodoc: <ide> def execute_grouped_calculation(operation, column_name, distinct) #:nodoc: <ide> relation = except(:group).group(group.join(',')) <ide> relation.select_values = select_values <ide> <del> calculated_data = @klass.connection.select_all(relation) <add> calculated_data = @klass.connection.select_all(relation, nil, bind_values) <ide> <ide> if association <ide> key_ids = calculated_data.collect { |row| row[group_aliases.first] } <ide><path>activerecord/lib/active_record/relation/finder_methods.rb <ide> def exists?(id = false) <ide> relation = relation.where(table[primary_key].eq(id)) if id <ide> end <ide> <del> connection.select_value(relation, "#{name} Exists") ? true : false <add> connection.select_value(relation, "#{name} Exists", relation.bind_values) ? true : false <ide> end <ide> <ide> protected <ide> def find_one(id) <ide> <ide> substitute = connection.substitute_at(column, @bind_values.length) <ide> relation = where(table[primary_key].eq(substitute)) <del> relation.bind_values = [[column, id]] <add> relation.bind_values += [[column, id]] <ide> record = relation.first <ide> <ide> unless record <ide><path>activerecord/lib/active_record/relation/spawn_methods.rb <ide> def merge(r) <ide> end <ide> end <ide> <del> (Relation::MULTI_VALUE_METHODS - [:joins, :where, :order]).each do |method| <add> (Relation::MULTI_VALUE_METHODS - [:joins, :where, :order, :binds]).each do |method| <ide> value = r.send(:"#{method}_values") <ide> next if value.empty? <ide> <ide> def merge(r) <ide> <ide> merged_wheres = @where_values + r.where_values <ide> <add> merged_binds = (@bind_values + r.bind_values).uniq(&:first) <add> <ide> unless @where_values.empty? <ide> # Remove duplicates, last one wins. <ide> seen = Hash.new { |h,table| h[table] = {} } <ide> def merge(r) <ide> end <ide> <ide> merged_relation.where_values = merged_wheres <add> merged_relation.bind_values = merged_binds <ide> <ide> (Relation::SINGLE_VALUE_METHODS - [:lock, :create_with, :reordering]).each do |method| <ide> value = r.send(:"#{method}_value")
6
Javascript
Javascript
relax challenge validation for multiple seeds
b25089d7c8ff0ec5d55881116165badee3405576
<ide><path>curriculum/test/test-challenges.js <ide> function populateTestsForLang({ lang, challenges, meta }) { <ide> return; <ide> } <ide> <del> if (files.length > 1) { <del> it('Check tests.', () => { <del> throw new Error('Seed file should be only the one.'); <del> }); <del> return; <del> } <del> <ide> const buildChallenge = <ide> challengeType === challengeTypes.js || <ide> challengeType === challengeTypes.bonfire <ide> ? buildJSChallenge <ide> : buildDOMChallenge; <ide> <add> // TODO: create more sophisticated validation now we allow for more <add> // than one seed/solution file. <add> <ide> files = files.map(createPoly); <ide> it('Test suite must fail on the initial contents', async function() { <ide> this.timeout(5000 * tests.length + 1000); <ide> function populateTestsForLang({ lang, challenges, meta }) { <ide> }); <ide> } <ide> <add>// TODO: solutions will need to be multi-file, too, with a fallback when there <add>// is only one file. <add>// we cannot simply use the solution instead of files, because the are not <add>// just the seed(s), they contain the head and tail code. The best approach <add>// is probably to separate out the head and tail from the files. Then the <add>// files can be entirely replaced by the solution. <add> <ide> async function createTestRunner( <ide> { required = [], template, files }, <ide> solution, <ide> buildChallenge <ide> ) { <add> // TODO: solutions will need to be multi-file, too, with a fallback when there <add> // is only one file. <add> // we cannot simply use the solution instead of files, because the are not <add> // just the seed(s), they contain the head and tail code. The best approach <add> // is probably to separate out the head and tail from the files. Then the <add> // files can be entirely replaced by the solution. <ide> if (solution) { <ide> files[0].contents = solution; <ide> }
1
Javascript
Javascript
add scrolling attribute for <iframe>
8a69b5bc984184c9b7f3b25a4936a6df4f339a6f
<ide><path>src/browser/ui/dom/DefaultDOMPropertyConfig.js <ide> var DefaultDOMPropertyConfig = { <ide> sandbox: null, <ide> scope: null, <ide> scrollLeft: MUST_USE_PROPERTY, <add> scrolling: null, <ide> scrollTop: MUST_USE_PROPERTY, <ide> seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, <ide> selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
1
Text
Text
replace undocumented encoding aliases
93d113510d0353d66d72bfd67e338e9ad6031523
<ide><path>doc/api/errors.md <ide> Example <ide> const Socket = require('net').Socket; <ide> const instance = new Socket(); <ide> <del>instance.setEncoding('utf-8'); <add>instance.setEncoding('utf8'); <ide> ``` <ide> <ide> <a id="ERR_TLS_CERT_ALTNAME_INVALID"></a> <ide><path>doc/api/fs.md <ide> If the file previously was shorter than `len` bytes, it is extended, and the <ide> extended part is filled with null bytes ('\0'). For example, <ide> <ide> ```js <del>console.log(fs.readFileSync('temp.txt', 'utf-8')); <add>console.log(fs.readFileSync('temp.txt', 'utf8')); <ide> // Prints: Node.js <ide> <ide> // get the file descriptor of the file to be truncated
2
Text
Text
remove unnecessary stability specifiers
5ab24edb025f8433d6f971d1cf8f9c51023a4f63
<ide><path>doc/api/dns.md <ide> earlier ones time out or result in some other error. <ide> <ide> ## DNS Promises API <ide> <del>> Stability: 2 - Stable <del> <ide> The `dns.promises` API provides an alternative set of asynchronous DNS methods <ide> that return `Promise` objects rather than using callbacks. The API is accessible <ide> via `require('dns').promises`. <ide><path>doc/api/fs.md <ide> this API: [`fs.write(fd, string...)`][]. <ide> <ide> ## fs Promises API <ide> <del>> Stability: 2 - Stable <del> <ide> The `fs.promises` API provides an alternative set of asynchronous file system <ide> methods that return `Promise` objects rather than using callbacks. The <ide> API is accessible via `require('fs').promises`. <ide><path>doc/api/stream.md <ide> changes: <ide> description: Symbol.asyncIterator support is no longer experimental. <ide> --> <ide> <del>> Stability: 2 - Stable <del> <ide> * Returns: {AsyncIterator} to fully consume the stream. <ide> <ide> ```js
3
Javascript
Javascript
move noop functions to `angular.noop`
4883e957971f1c551a0f560427bba0224f291449
<ide><path>src/ng/animate.js <ide> function prepareAnimateOptions(options) { <ide> } <ide> <ide> var $$CoreAnimateJsProvider = function() { <del> this.$get = function() {}; <add> this.$get = noop; <ide> }; <ide> <ide> // this is prefixed with Core since it conflicts with <ide><path>src/ng/compile.js <ide> function $CompileProvider($provide, $$sanitizeUriProvider) { <ide> * See also {@link ng.$compileProvider#directive $compileProvider.directive()}. <ide> */ <ide> this.component = function registerComponent(name, options) { <del> var controller = options.controller || function() {}; <add> var controller = options.controller || noop; <ide> <ide> function factory($injector) { <ide> function makeInjectable(fn) { <ide><path>src/ng/parse.js <ide> ASTInterpreter.prototype = { <ide> forEach(ast.body, function(expression) { <ide> expressions.push(self.recurse(expression.expression)); <ide> }); <del> var fn = ast.body.length === 0 ? function() {} : <add> var fn = ast.body.length === 0 ? noop : <ide> ast.body.length === 1 ? expressions[0] : <ide> function(scope, locals) { <ide> var lastValue;
3
Javascript
Javascript
add test description to fs.readfile tests
dd2200ecf831cae5f57b69e3ee8a934efbe20af8
<ide><path>test/parallel/test-fs-readfile-empty.js <ide> <ide> 'use strict'; <ide> require('../common'); <add> <add>// Trivial test of fs.readFile on an empty file. <add> <ide> const assert = require('assert'); <ide> const fs = require('fs'); <ide> const fixtures = require('../common/fixtures'); <ide><path>test/parallel/test-fs-readfile-error.js <ide> <ide> 'use strict'; <ide> const common = require('../common'); <add> <add>// Test that fs.readFile fails correctly on a non-existent file. <add> <ide> // `fs.readFile('/')` does not fail on FreeBSD, because you can open and read <ide> // the directory there. <ide> if (common.isFreeBSD) <ide><path>test/parallel/test-fs-readfile-fd.js <ide> 'use strict'; <ide> require('../common'); <add> <add>// Test fs.readFile using a file descriptor. <add> <ide> const fixtures = require('../common/fixtures'); <ide> const assert = require('assert'); <ide> const fs = require('fs'); <ide><path>test/parallel/test-fs-readfile-unlink.js <ide> <ide> 'use strict'; <ide> const common = require('../common'); <add> <add>// Test that unlink succeeds immediately after readFile completes. <add> <ide> const assert = require('assert'); <ide> const fs = require('fs'); <ide> const path = require('path'); <ide><path>test/parallel/test-fs-readfile-zero-byte-liar.js <ide> <ide> 'use strict'; <ide> const common = require('../common'); <add> <add>// Test that readFile works even when stat returns size 0. <add> <ide> const assert = require('assert'); <ide> const fs = require('fs'); <ide>
5
Python
Python
add failing test for
94e5d05caa285180356fa36e946433b5c93745b1
<ide><path>tests/test_serializer.py <ide> def test_default_not_used_when_in_object(self): <ide> serializer = self.Serializer(instance) <ide> assert serializer.data == {'has_default': 'def', 'has_default_callable': 'ghi', 'no_default': 'abc'} <ide> <add> def test_default_for_source_source(self): <add> """ <add> 'default="something"' should be used when a traversed attribute is missing from input. <add> """ <add> class Serializer(serializers.Serializer): <add> traversed = serializers.CharField(default='x', source='traversed.attr') <add> <add> assert Serializer({}).data == {'traversed': 'x'} <add> assert Serializer({'traversed': {}}).data == {'traversed': 'x'} <add> assert Serializer({'traversed': None}).data == {'traversed': 'x'} <add> <add> assert Serializer({'traversed': {'attr': 'abc'}}).data == {'traversed': 'abc'} <add> <ide> <ide> class TestCacheSerializerData: <ide> def test_cache_serializer_data(self):
1
Java
Java
fix typo in reflectionutilstests
c84dd55863c4d872fef4f4334fd94051d266490a
<ide><path>spring-core/src/test/java/org/springframework/util/ReflectionUtilsTests.java <ide> void m95() { } void m96() { } void m97() { } void m98() { } void m99() { } <ide> } <ide> <ide> @Test <del> void getDecalredMethodsReturnsCopy() { <add> void getDeclaredMethodsReturnsCopy() { <ide> Method[] m1 = ReflectionUtils.getDeclaredMethods(A.class); <ide> Method[] m2 = ReflectionUtils.getDeclaredMethods(A.class); <ide> assertThat(m1). isNotSameAs(m2);
1
Ruby
Ruby
use existing tmpdir in evented_file_update_test
f1084f2d0eaf8405284b2da19e8ac2c2eb7063ad
<ide><path>activesupport/test/evented_file_update_checker_test.rb <ide> def touch(files) <ide> end <ide> <ide> test "updated should become true when nonexistent directory is added later" do <del> Dir.mktmpdir do |dir| <del> watched_dir = File.join(dir, "app") <del> unwatched_dir = File.join(dir, "node_modules") <del> not_exist_watched_dir = File.join(dir, "test") <add> watched_dir = File.join(tmpdir, "app") <add> unwatched_dir = File.join(tmpdir, "node_modules") <add> not_exist_watched_dir = File.join(tmpdir, "test") <ide> <del> Dir.mkdir(watched_dir) <del> Dir.mkdir(unwatched_dir) <add> Dir.mkdir(watched_dir) <add> Dir.mkdir(unwatched_dir) <ide> <del> checker = new_checker([], watched_dir => ".rb", not_exist_watched_dir => ".rb") { } <add> checker = new_checker([], watched_dir => ".rb", not_exist_watched_dir => ".rb") { } <ide> <del> FileUtils.touch(File.join(watched_dir, "a.rb")) <del> wait <del> assert_predicate checker, :updated? <del> assert checker.execute_if_updated <add> FileUtils.touch(File.join(watched_dir, "a.rb")) <add> wait <add> assert_predicate checker, :updated? <add> assert checker.execute_if_updated <ide> <del> Dir.mkdir(not_exist_watched_dir) <del> wait <del> assert_predicate checker, :updated? <del> assert checker.execute_if_updated <add> Dir.mkdir(not_exist_watched_dir) <add> wait <add> assert_predicate checker, :updated? <add> assert checker.execute_if_updated <ide> <del> FileUtils.touch(File.join(unwatched_dir, "a.rb")) <del> wait <del> assert_not_predicate checker, :updated? <del> assert_not checker.execute_if_updated <del> end <add> FileUtils.touch(File.join(unwatched_dir, "a.rb")) <add> wait <add> assert_not_predicate checker, :updated? <add> assert_not checker.execute_if_updated <ide> end <ide> end <ide>
1
Javascript
Javascript
fix sparse array inspection
6bba368ccf43cd7bd4c003007237b55c0a16511d
<ide><path>lib/util.js <ide> function formatNamespaceObject(ctx, value, recurseTimes, keys) { <ide> function formatSpecialArray(ctx, value, recurseTimes, keys, maxLength, valLen) { <ide> const output = []; <ide> const keyLen = keys.length; <del> let visibleLength = 0; <ide> let i = 0; <del> if (keyLen !== 0 && numberRegExp.test(keys[0])) { <del> for (const key of keys) { <del> if (visibleLength === maxLength) <add> for (const key of keys) { <add> if (output.length === maxLength) <add> break; <add> const index = +key; <add> // Arrays can only have up to 2^32 - 1 entries <add> if (index > 2 ** 32 - 2) <add> break; <add> if (`${i}` !== key) { <add> if (!numberRegExp.test(key)) <ide> break; <del> const index = +key; <del> // Arrays can only have up to 2^32 - 1 entries <del> if (index > 2 ** 32 - 2) <add> const emptyItems = index - i; <add> const ending = emptyItems > 1 ? 's' : ''; <add> const message = `<${emptyItems} empty item${ending}>`; <add> output.push(ctx.stylize(message, 'undefined')); <add> i = index; <add> if (output.length === maxLength) <ide> break; <del> if (i !== index) { <del> if (!numberRegExp.test(key)) <del> break; <del> const emptyItems = index - i; <del> const ending = emptyItems > 1 ? 's' : ''; <del> const message = `<${emptyItems} empty item${ending}>`; <del> output.push(ctx.stylize(message, 'undefined')); <del> i = index; <del> if (++visibleLength === maxLength) <del> break; <del> } <del> output.push(formatProperty(ctx, value, recurseTimes, key, 1)); <del> visibleLength++; <del> i++; <ide> } <add> output.push(formatProperty(ctx, value, recurseTimes, key, 1)); <add> i++; <ide> } <del> if (i < valLen && visibleLength !== maxLength) { <add> if (i < valLen && output.length !== maxLength) { <ide> const len = valLen - i; <ide> const ending = len > 1 ? 's' : ''; <ide> const message = `<${len} empty item${ending}>`; <ide><path>test/parallel/test-util-inspect.js <ide> assert.strictEqual( <ide> "[ <2 empty items>, '00': 1, '01': 2 ]"); <ide> assert.strictEqual(util.inspect(arr2, { showHidden: true }), <ide> "[ <2 empty items>, [length]: 2, '00': 1, '01': 2 ]"); <add> delete arr2['00']; <add> arr2[0] = 0; <add> assert.strictEqual(util.inspect(arr2), <add> "[ 0, <1 empty item>, '01': 2 ]"); <add> assert.strictEqual(util.inspect(arr2, { showHidden: true }), <add> "[ 0, <1 empty item>, [length]: 2, '01': 2 ]"); <add> delete arr2['01']; <add> arr2[2 ** 32 - 2] = 'max'; <add> arr2[2 ** 32 - 1] = 'too far'; <add> assert.strictEqual( <add> util.inspect(arr2), <add> "[ 0, <4294967293 empty items>, 'max', '4294967295': 'too far' ]" <add> ); <ide> <ide> const arr3 = []; <ide> arr3[-1] = -1;
2
Text
Text
add missing stuff
50110866c20605420770ae1915f6143802a854bb
<ide><path>README.md <ide> If you’re coming from Flux, there is a single important difference you need to <ide> <ide> This architecture might seem like an overkill for a counter app, but the beauty of this pattern is how well it scales to large and complex apps. It also enables very powerful developer tools, because it is possible to trace every mutation to the action that caused it. You can record user sessions and reproduce them just by replaying every action. <ide> <add>### Discussion <add> <add>Join the **#redux** channel of the [Reactiflux](http://reactiflux.com/) Slack community. <add> <add>### Thanks <add> <add>* [The Elm Architecture](https://github.com/evancz/elm-architecture-tutorial) for a great intro to modeling state updates with reducers; <add>* [Turning the database inside-out](http://blog.confluent.io/2015/03/04/turning-the-database-inside-out-with-apache-samza/) for blowing my mind; <add>* [Developing ClojureScript with Figwheel](http://www.youtube.com/watch?v=j-kj2qwJa_E) for convincing me that re-evaluation should “just work”; <add>* [Webpack](https://github.com/webpack/docs/wiki/hot-module-replacement-with-webpack) for Hot Module Replacement; <add>* [Flummox](https://github.com/acdlite/flummox) for teaching me to approach Flux without boilerplate or singletons; <add>* [disto](https://github.com/threepointone/disto) for a proof of concept of hot reloadable Stores; <add>* [NuclearJS](https://github.com/optimizely/nuclear-js) for proving this architecture can be performant; <add>* [Om](https://github.com/omcljs/om) for popularizing the idea of a single state atom; <add>* [Cycle](https://github.com/staltz/cycle) for showing how often a function is the best tool; <add>* [React](https://github.com/facebook/react) for the pragmatic innovation. <add> <add>Special thanks to [Jamie Paton](http://jdpaton.github.io/) for handing over the `redux` NPM package name. <add> <ide> ### License <ide> <ide> MIT <add> <add><hr> <add> <add>[![build status](https://img.shields.io/travis/gaearon/redux/master.svg?style=flat-square)](https://travis-ci.org/gaearon/redux) <add>[![npm version](https://img.shields.io/npm/v/redux.svg?style=flat-square)](https://www.npmjs.com/package/redux) <add>[![redux channel on slack](https://img.shields.io/badge/slack-redux@reactiflux-61DAFB.svg?style=flat-square)](http://www.reactiflux.com) <ide>\ No newline at end of file
1
Python
Python
initialize the default rank set on trainerstate
1cd2e21d1b540cb5203a07b31ee3e954425ee7a9
<ide><path>src/transformers/trainer.py <ide> def __init__( <ide> else: <ide> self.label_smoother = None <ide> <del> self.state = TrainerState() <add> self.state = TrainerState( <add> is_local_process_zero=self.is_local_process_zero(), <add> is_world_process_zero=self.is_world_process_zero(), <add> ) <add> <ide> self.control = TrainerControl() <ide> # Internal variable to count flos in each process, will be accumulated in `self.state.total_flos` then <ide> # returned to 0 every time flos need to be logged
1
Python
Python
add support for creating security group
1e5c631bd60eaeaa4314286669c25ba409d95c70
<ide><path>example_aliyun_ecs.py <ide> # See the License for the specific language governing permissions and <ide> # limitations under the License. <ide> <add>import sys <add> <ide> from libcloud.compute.types import Provider <ide> from libcloud.compute.providers import get_driver <ide> from libcloud.compute.base import NodeAuthPassword <ide> <ide> sgs = ecs.ex_list_security_groups() <ide> print('Found %d security groups' % len(sgs)) <del>sg = sgs[0] <del>print('Use security group %s' % sg) <add>if len(sgs) == 0: <add> sg = ecs.ex_create_security_groups(ex_description='test') <add> print('Create security group %s' % sg) <add>else: <add> sg = sgs[0] <add> print('Use security group %s' % sg) <ide> <ide> nodes = ecs.list_nodes() <ide> print('Found %d nodes' % len(nodes)) <ide><path>libcloud/compute/drivers/ecs.py <ide> def ex_stop_node(self, node, ex_force_stop=False): <ide> return resp.success() and \ <ide> self._wait_until_state([node], NodeState.STOPPED) <ide> <add> def ex_create_security_groups(self, ex_description=None, <add> ex_client_token=None): <add> """ <add> Create a new security groups. <add> <add> :keyword ex_description: volume description <add> :type ex_description: ``unicode`` <add> <add> :keyword ex_client_token: a token generated by client to identify <add> each request. <add> :type ex_client_token: ``str`` <add> """ <add> params = {'Action': 'CreateSecurityGroup', <add> 'RegionId': self.region} <add> <add> if ex_description: <add> params['Description'] = ex_description <add> if ex_client_token: <add> params['ClientToken'] = ex_client_token <add> return self.connection.request(self.path, params).object <add> <ide> def ex_list_security_groups(self, ex_filters=None): <ide> """ <ide> List security groups in the current region.
2
Ruby
Ruby
use global cache again
50aa91940daa7c8f070d48155d3f07692f47f41a
<ide><path>Library/Contributions/cmd/brew-test-bot.rb <ide> # --email: Generate an email subject file. <ide> # --no-bottle: Run brew install without --build-bottle <ide> # --HEAD: Run brew install with --HEAD <del># --local: Output logs and cache downloads under ./{logs,cache} <add># --local: Ask Homebrew to write verbose logs under ./logs/ <ide> # <ide> # --ci-master: Shortcut for Homebrew master branch CI options. <ide> # --ci-pr: Shortcut for Homebrew pull request CI options. <ide> def bottle_upload <ide> <ide> if ARGV.include? '--local' <ide> ENV['HOMEBREW_LOGS'] = "#{Dir.pwd}/logs" <del> ENV['HOMEBREW_CACHE'] = "#{Dir.pwd}/cache" <ide> end <ide> <ide> tests = []
1
Python
Python
apply unpack_input decorator to vit model
841620684b75ce63918e8e9dfecdd3b46394bbc1
<ide><path>src/transformers/models/vit/modeling_tf_vit.py <ide> TFPreTrainedModel, <ide> TFSequenceClassificationLoss, <ide> get_initializer, <del> input_processing, <ide> keras_serializable, <add> unpack_inputs, <ide> ) <ide> from ...tf_utils import shape_list <ide> from ...utils import logging <ide> class PreTrainedModel <ide> """ <ide> raise NotImplementedError <ide> <add> @unpack_inputs <ide> def call( <ide> self, <ide> pixel_values: Optional[TFModelInputType] = None, <ide> def call( <ide> training: bool = False, <ide> **kwargs, <ide> ) -> Union[TFBaseModelOutputWithPooling, Tuple[tf.Tensor]]: <del> inputs = input_processing( <del> func=self.call, <del> config=self.config, <del> input_ids=pixel_values, <del> head_mask=head_mask, <del> output_attentions=output_attentions, <del> output_hidden_states=output_hidden_states, <del> interpolate_pos_encoding=interpolate_pos_encoding, <del> return_dict=return_dict, <del> training=training, <del> kwargs_call=kwargs, <del> ) <del> <del> if "input_ids" in inputs: <del> inputs["pixel_values"] = inputs.pop("input_ids") <ide> <del> if inputs["pixel_values"] is None: <add> if pixel_values is None: <ide> raise ValueError("You have to specify pixel_values") <ide> <ide> embedding_output = self.embeddings( <del> pixel_values=inputs["pixel_values"], <del> interpolate_pos_encoding=inputs["interpolate_pos_encoding"], <del> training=inputs["training"], <add> pixel_values=pixel_values, <add> interpolate_pos_encoding=interpolate_pos_encoding, <add> training=training, <ide> ) <ide> <ide> # Prepare head mask if needed <ide> # 1.0 in head_mask indicate we keep the head <ide> # attention_probs has shape bsz x n_heads x N x N <ide> # input head_mask has shape [num_heads] or [num_hidden_layers x num_heads] <ide> # and head_mask is converted to shape [num_hidden_layers x batch x num_heads x seq_length x seq_length] <del> if inputs["head_mask"] is not None: <add> if head_mask is not None: <ide> raise NotImplementedError <ide> else: <del> inputs["head_mask"] = [None] * self.config.num_hidden_layers <add> head_mask = [None] * self.config.num_hidden_layers <ide> <ide> encoder_outputs = self.encoder( <ide> hidden_states=embedding_output, <del> head_mask=inputs["head_mask"], <del> output_attentions=inputs["output_attentions"], <del> output_hidden_states=inputs["output_hidden_states"], <del> return_dict=inputs["return_dict"], <del> training=inputs["training"], <add> head_mask=head_mask, <add> output_attentions=output_attentions, <add> output_hidden_states=output_hidden_states, <add> return_dict=return_dict, <add> training=training, <ide> ) <ide> <ide> sequence_output = encoder_outputs[0] <ide> sequence_output = self.layernorm(inputs=sequence_output) <ide> pooled_output = self.pooler(hidden_states=sequence_output) if self.pooler is not None else None <ide> <del> if not inputs["return_dict"]: <add> if not return_dict: <ide> return (sequence_output, pooled_output) + encoder_outputs[1:] <ide> <ide> return TFBaseModelOutputWithPooling( <ide> def __init__(self, config: ViTConfig, *inputs, add_pooling_layer=True, **kwargs) <ide> <ide> self.vit = TFViTMainLayer(config, add_pooling_layer=add_pooling_layer, name="vit") <ide> <add> @unpack_inputs <ide> @add_start_docstrings_to_model_forward(VIT_INPUTS_DOCSTRING) <ide> @replace_return_docstrings(output_type=TFBaseModelOutputWithPooling, config_class=_CONFIG_FOR_DOC) <ide> def call( <ide> def call( <ide> >>> outputs = model(**inputs) <ide> >>> last_hidden_states = outputs.last_hidden_state <ide> ```""" <del> inputs = input_processing( <del> func=self.call, <del> config=self.config, <del> input_ids=pixel_values, <add> <add> outputs = self.vit( <add> pixel_values=pixel_values, <ide> head_mask=head_mask, <ide> output_attentions=output_attentions, <ide> output_hidden_states=output_hidden_states, <ide> interpolate_pos_encoding=interpolate_pos_encoding, <ide> return_dict=return_dict, <ide> training=training, <del> kwargs_call=kwargs, <del> ) <del> <del> if "input_ids" in inputs: <del> inputs["pixel_values"] = inputs.pop("input_ids") <del> <del> outputs = self.vit( <del> pixel_values=inputs["pixel_values"], <del> head_mask=inputs["head_mask"], <del> output_attentions=inputs["output_attentions"], <del> output_hidden_states=inputs["output_hidden_states"], <del> interpolate_pos_encoding=inputs["interpolate_pos_encoding"], <del> return_dict=inputs["return_dict"], <del> training=inputs["training"], <ide> ) <ide> <ide> return outputs <ide> def __init__(self, config: ViTConfig, *inputs, **kwargs): <ide> name="classifier", <ide> ) <ide> <add> @unpack_inputs <ide> @add_start_docstrings_to_model_forward(VIT_INPUTS_DOCSTRING) <ide> @replace_return_docstrings(output_type=TFSequenceClassifierOutput, config_class=_CONFIG_FOR_DOC) <ide> def call( <ide> def call( <ide> >>> predicted_class_idx = tf.math.argmax(logits, axis=-1)[0] <ide> >>> print("Predicted class:", model.config.id2label[int(predicted_class_idx)]) <ide> ```""" <del> inputs = input_processing( <del> func=self.call, <del> config=self.config, <del> input_ids=pixel_values, <add> <add> outputs = self.vit( <add> pixel_values=pixel_values, <ide> head_mask=head_mask, <ide> output_attentions=output_attentions, <ide> output_hidden_states=output_hidden_states, <ide> interpolate_pos_encoding=interpolate_pos_encoding, <ide> return_dict=return_dict, <del> labels=labels, <ide> training=training, <del> kwargs_call=kwargs, <del> ) <del> <del> if "input_ids" in inputs: <del> inputs["pixel_values"] = inputs.pop("input_ids") <del> <del> outputs = self.vit( <del> pixel_values=inputs["pixel_values"], <del> head_mask=inputs["head_mask"], <del> output_attentions=inputs["output_attentions"], <del> output_hidden_states=inputs["output_hidden_states"], <del> interpolate_pos_encoding=inputs["interpolate_pos_encoding"], <del> return_dict=inputs["return_dict"], <del> training=inputs["training"], <ide> ) <ide> sequence_output = outputs[0] <ide> logits = self.classifier(inputs=sequence_output[:, 0, :]) <del> loss = None if inputs["labels"] is None else self.hf_compute_loss(labels=inputs["labels"], logits=logits) <add> loss = None if labels is None else self.hf_compute_loss(labels=labels, logits=logits) <ide> <del> if not inputs["return_dict"]: <add> if not return_dict: <ide> output = (logits,) + outputs[2:] <ide> return ((loss,) + output) if loss is not None else output <ide>
1
Java
Java
implement fabricviewstatemanager for reactedittext
065fbe3be53e156fe4f2dbf47791be53b340096f
<ide><path>ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java <ide> import com.facebook.infer.annotation.Assertions; <ide> import com.facebook.react.bridge.JavaOnlyMap; <ide> import com.facebook.react.bridge.ReactContext; <del>import com.facebook.react.uimanager.StateWrapper; <add>import com.facebook.react.uimanager.FabricViewStateManager; <ide> import com.facebook.react.uimanager.UIManagerModule; <ide> import com.facebook.react.views.text.ReactSpan; <ide> import com.facebook.react.views.text.ReactTextUpdate; <ide> * called this explicitly. This is the default behavior on other platforms as well. <ide> * VisibleForTesting from {@link TextInputEventsTestCase}. <ide> */ <del>public class ReactEditText extends AppCompatEditText { <add>public class ReactEditText extends AppCompatEditText <add> implements FabricViewStateManager.HasFabricViewStateManager { <ide> <ide> private final InputMethodManager mInputMethodManager; <ide> // This flag is set to true when we set the text of the EditText explicitly. In that case, no <ide> public class ReactEditText extends AppCompatEditText { <ide> private ReactViewBackgroundManager mReactBackgroundManager; <ide> <ide> protected @Nullable JavaOnlyMap mAttributedString = null; <del> protected @Nullable StateWrapper mStateWrapper = null; <add> private final FabricViewStateManager mFabricViewStateManager = new FabricViewStateManager(); <ide> protected boolean mDisableTextDiffing = false; <ide> <ide> protected boolean mIsSettingTextFromState = false; <ide> private void setIntrinsicContentSize() { <ide> // wrapper 100% of the time. <ide> // Since the LocalData object is constructed by getting values from the underlying EditText <ide> // view, we don't need to construct one or apply it at all - it provides no use in Fabric. <del> if (mStateWrapper == null) { <add> if (!mFabricViewStateManager.hasStateWrapper()) { <ide> ReactContext reactContext = getReactContext(this); <ide> final ReactTextInputLocalData localData = new ReactTextInputLocalData(this); <ide> UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); <ide> protected void applyTextAttributes() { <ide> } <ide> } <ide> <add> @Override <add> public FabricViewStateManager getFabricViewStateManager() { <add> return mFabricViewStateManager; <add> } <add> <ide> /** <ide> * This class will redirect *TextChanged calls to the listeners only in the case where the text is <ide> * changed by the user, and not explicitly set by JS. <ide><path>ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java <ide> import com.facebook.react.common.MapBuilder; <ide> import com.facebook.react.module.annotations.ReactModule; <ide> import com.facebook.react.uimanager.BaseViewManager; <add>import com.facebook.react.uimanager.FabricViewStateManager; <ide> import com.facebook.react.uimanager.LayoutShadowNode; <ide> import com.facebook.react.uimanager.PixelUtil; <ide> import com.facebook.react.uimanager.ReactStylesDiffMap; <ide> public void onTextChanged(CharSequence s, int start, int before, int count) { <ide> } <ide> <ide> // Fabric: update representation of AttributedString <del> JavaOnlyMap attributedString = mEditText.mAttributedString; <add> final JavaOnlyMap attributedString = mEditText.mAttributedString; <ide> if (attributedString != null && attributedString.hasKey("fragments")) { <ide> String changedText = s.subSequence(start, start + count).toString(); <ide> <ide> public void onTextChanged(CharSequence s, int start, int before, int count) { <ide> // we must recreate these data structures every time. It would be nice to have a <ide> // reusable data-structure to use for TextInput because constructing these and copying <ide> // on every keystroke is very expensive. <del> if (mEditText.mStateWrapper != null && attributedString != null) { <del> WritableMap map = new WritableNativeMap(); <del> WritableMap newAttributedString = new WritableNativeMap(); <del> <del> WritableArray fragments = new WritableNativeArray(); <del> <del> for (int i = 0; i < attributedString.getArray("fragments").size(); i++) { <del> ReadableMap readableFragment = attributedString.getArray("fragments").getMap(i); <del> WritableMap fragment = new WritableNativeMap(); <del> fragment.putDouble("reactTag", readableFragment.getInt("reactTag")); <del> fragment.putString("string", readableFragment.getString("string")); <del> fragments.pushMap(fragment); <del> } <del> <del> newAttributedString.putString("string", attributedString.getString("string")); <del> newAttributedString.putArray("fragments", fragments); <del> <del> map.putInt("mostRecentEventCount", mEditText.incrementAndGetEventCounter()); <del> map.putMap("textChanged", newAttributedString); <del> <del> mEditText.mStateWrapper.updateState(map); <add> if (mEditText.getFabricViewStateManager().hasStateWrapper() && attributedString != null) { <add> mEditText <add> .getFabricViewStateManager() <add> .setState( <add> new FabricViewStateManager.StateUpdateCallback() { <add> @Override <add> public WritableMap getStateUpdate() { <add> WritableMap map = new WritableNativeMap(); <add> WritableMap newAttributedString = new WritableNativeMap(); <add> <add> WritableArray fragments = new WritableNativeArray(); <add> <add> for (int i = 0; i < attributedString.getArray("fragments").size(); i++) { <add> ReadableMap readableFragment = <add> attributedString.getArray("fragments").getMap(i); <add> WritableMap fragment = new WritableNativeMap(); <add> fragment.putDouble("reactTag", readableFragment.getInt("reactTag")); <add> fragment.putString("string", readableFragment.getString("string")); <add> fragments.pushMap(fragment); <add> } <add> <add> newAttributedString.putString("string", attributedString.getString("string")); <add> newAttributedString.putArray("fragments", fragments); <add> <add> map.putInt("mostRecentEventCount", mEditText.incrementAndGetEventCounter()); <add> map.putMap("textChanged", newAttributedString); <add> return map; <add> } <add> }); <ide> } <ide> <ide> // The event that contains the event counter and updates it must be sent first. <ide> protected EditText createInternalEditText(ThemedReactContext themedReactContext) <ide> @Override <ide> public Object updateState( <ide> ReactEditText view, ReactStylesDiffMap props, @Nullable StateWrapper stateWrapper) { <add> <add> view.getFabricViewStateManager().setStateWrapper(stateWrapper); <add> <ide> if (stateWrapper == null) { <ide> throw new IllegalArgumentException("Unable to update a NULL state."); <ide> } <ide> public Object updateState( <ide> int textBreakStrategy = <ide> TextAttributeProps.getTextBreakStrategy(paragraphAttributes.getString("textBreakStrategy")); <ide> <del> view.mStateWrapper = stateWrapper; <ide> return ReactTextUpdate.buildReactTextUpdateFromState( <ide> spanned, <ide> state.getInt("mostRecentEventCount"),
2