Commit Graph

2474 Commits

Author SHA1 Message Date
Brian Clozel
cc026fcb8a Polish "Optimize allocation in StringUtils#cleanPath"
This commit also introduces JMH benchmarks related to the code
optimizations.

Closes gh-2631
2021-08-30 18:26:51 +02:00
Daniel Knittl-Frank
8d3e8ca3a2 Optimize allocation in StringUtils#cleanPath
This commit applies several optimizations to StringUtils#cleanPath and
related methods:

* pre-size pathElements deque in StringUtils#cleanPath with
  pathElements.length elements, since this this is the maximum size and
  the most likely case.
* optimize StringUtils#collectionToDelimitedString to calculate the size
  of the resulting String and avoid array auto-resizing in the
  StringBuilder.
* If the path did not contain any components that required cleaning,
  return the (normalized) path as-is. No need to concatenate the prefix
  and the trailing path.

See gh-26316
2021-08-30 18:09:52 +02:00
Stephane Nicoll
af6fd6c303 Polish "Fix duplicate "the" in Javadoc and XSD"
See gh-27291
2021-08-19 08:54:38 +02:00
Sanghyuk Jung
ac72277258 Fix duplicate "the" in Javadoc and XSD
See gh-27291
2021-08-19 08:44:03 +02:00
Stephane Nicoll
31b651a114 Polish contribution
See gh-27248
2021-08-08 11:33:26 +02:00
Syuziko
eaf9deedfd Polish tests
See gh-27248
2021-08-07 18:53:47 +02:00
Sam Brannen
915f1027a5 Update copyright date
See gh-27223
2021-07-29 11:04:59 +02:00
Mateusz Swiatkowski
f1b35f1593 Fix reference to Optional.isPresent() in ObjectUtils.isEmpty()
Closes gh-27223
2021-07-29 11:03:26 +02:00
Sam Brannen
3ccbf1edeb Increase fudge factor in StopWatchTests 2021-06-30 10:43:52 +02:00
Sam Brannen
a2ef6badc4 Use StringBuilder.append(char) where possible
To slightly improve performance, this commit switches to
StringBuilder.append(char) instead of StringBuilder.append(String)
whenever we append a single character to a StringBuilder.

Closes gh-27098
2021-06-25 10:44:28 +02:00
Sam Brannen
ddbb7c1b5b Avoid use of Supplier in MergedAnnotationReadingVisitor.get 2021-06-24 16:41:28 +02:00
Sam Brannen
2bc7a3aa0a Implement equals, hashCode, & toString in BeanMethod and *Metadata types
Prior to this commit, ConfigurationClass implemented equals(),
hashCode(), and toString(), but BeanMethod did not.

This commit introduces equals(), hashCode(), and toString()
implementations in BeanMethod for consistency with ConfigurationClass
to make it possible to use BeanMethod instances to index additional
metadata as well.

In order to properly implement equals() in BeanMethod, the method
argument types are required, but these are not directly available in
BeanMethod. However, they are available via ASM when processing @Bean
methods. This commit therefore implements equals(), hashCode(), and
toString() in SimpleMethodMetadata which BeanMethod delegates to.

For completeness, this commit also implements equals(), hashCode(), and
toString() in StandardClassMetadata, StandardMethodMetadata, and
SimpleAnnotationMetadata.

Closes gh-27076
2021-06-24 16:41:28 +02:00
Sam Brannen
882004fc9b Fix bug in SimpleMethodMetadataReadingVisitor.Source.toString()
Prior to this commit, the toString() implementation did not separate
method argument types with a comma or any form of separator, leading
to results such as:

    org.example.MyClass.myMethod(java.lang.Stringjava.lang.Integer)

instead of:

    org.example.MyClass.myMethod(java.lang.String,java.lang.Integer)

Closes gh-27095
2021-06-24 16:41:28 +02:00
Sam Brannen
1bc236785c Polishing 2021-06-24 15:47:24 +02:00
Sam Brannen
d469f6215d Polishing 2021-06-22 19:54:05 +02:00
Juergen Hoeller
edf0343cfe Upgrade to ASM master (including early support for Java 18 bytecode)
Closes gh-27069
2021-06-22 15:26:35 +02:00
Sam Brannen
782d7169e4 Polish Javadoc for MethodMetadata 2021-06-21 18:04:37 +02:00
Juergen Hoeller
d29d4d45aa Upgrade to ASM master
Closes gh-27023
2021-06-07 12:28:17 +02:00
Sam Brannen
432fdad7d0 Polish contribution
See gh-26982
2021-06-04 15:32:29 +02:00
nhavuong
345d8186d4 Add more test cases for SimpleAliasRegistry
Closes gh-26982
2021-06-04 15:18:46 +02:00
Сергей Цыпанов
c9d341e9c0 Simplify String construction in StringUtils.changeFirstCharacterCase()
Closes gh-27012
2021-06-04 11:49:59 +02:00
Angel Aguilera
950b183715 Adjust expected IdentityHashMap sizes in ClassUtils
Proposed change aimed to keep coherence between variable declaration 
and static initialization code, which stores 9 values, not 8, in these
two maps.

Closes gh-27016
2021-06-04 10:48:44 +02:00
Brian Clozel
7dbbf364f7 Make FlightRecorderApplicationStartup thread safe
Prior to this commit, in some cases application context startup steps
could be created concurrently, which could cause issues with the current
implementation tracking the parent/child relationship between steps.

This commit ensures that the flight recorder implementation is using
thread safe collection implementations for that.

Fixes gh-26941
2021-06-01 15:11:23 +02:00
Brian Clozel
5204d736f3 Return static DefaultApplicationStartup step
This commit ensures that `DefaultApplicationStartup` returns a static
step for each call to avoid allocations.

Closes gh-26939
2021-06-01 15:06:19 +02:00
izeye
ab2c78a9d5 Fix broken Javadoc tags
Closes gh-26967
2021-05-23 18:09:34 +02:00
Sébastien Deleuze
3dba3691a7 Upgrade to Coroutines 1.5.0
This commit upgrades to Coroutines 1.5.0 while retaining
Coroutines 1.4.x compatibility.

Closes gh-26897
2021-05-17 11:37:02 +02:00
Sam Brannen
e31a4c4c77 Polishing 2021-05-12 11:31:15 +02:00
Juergen Hoeller
1469bdbc70 Nullability refinements and related polishing 2021-05-11 16:50:19 +02:00
Arjen Poutsma
b18cf3c873 Follow contract of computeIfAbsent LinkedCaseInsensitiveMap
This commit makes sure that LinkedCaseInsensitiveMap::computeIfAbsent
honors the contract of the method, and also replaces the old entry if
that mapped to null.

Closes gh-26868
2021-04-30 15:49:00 +02:00
Arjen Poutsma
399e7ebf22 Follow contract of putIfAbsent LinkedCaseInsensitiveMap
This commit makes sure that LinkedCaseInsensitiveMap::putIfAbsent honors
the contract of the method, and also replaces the old entry if that
mapped to null.

Closes gh-26868
2021-04-30 15:17:46 +02:00
Sam Brannen
ff9b68c1b6 Update copyright date for StaxEventXMLReader
See gh-26875
2021-04-29 18:01:27 +02:00
Tasuku Nakagawa
36c829386b Use an import instead of FQCN in StaxEventXMLReader
Closes gh-26875
2021-04-29 17:59:26 +02:00
Sébastien Deleuze
d7f67b3dc3 Fix a typo in PropertyResolverExtensions documentation 2021-04-28 12:17:27 +02:00
Сергей Цыпанов
db9a10bf35 Use String.startsWith() instead of substring() in PatternMatchUtils
Closes gh-26822
2021-04-21 13:56:38 +02:00
Sébastien Deleuze
eca87b87de Improve Kotlin support in BridgeMethodResolver#findBridgedMethod
This commit adds support for Kotlin non-nullable type which resolves
to primitive Java types in BridgeMethodResolver#findBridgedMethod.

Closes gh-26585
2021-04-01 15:39:53 +02:00
Rossen Stoyanchev
5e1e29a2dd Fix failing tests
See gh-26746
2021-03-31 12:25:39 +01:00
Juergen Hoeller
5b227e5677 Upgrade to Objenesis 3.2
Closes gh-26714
2021-03-22 23:11:30 +01:00
Stephane Nicoll
12f8cdd715 Update copyright year of changed files
See gh-26673
2021-03-13 18:03:26 +01:00
Rebwon
2daefedf5e Polish
See gh-26673
2021-03-13 18:02:54 +01:00
Juergen Hoeller
01bf1c9021 Polishing 2021-03-09 00:08:03 +01:00
Juergen Hoeller
530fb0808d Polishing 2021-03-08 23:45:56 +01:00
Qimiao Chen
75b6540bd8 Specify 20 to the initial size of the ArrayList 2021-03-08 18:56:22 +01:00
Juergen Hoeller
b5147a034c Polishing
See gh-26574
See gh-26575
2021-02-25 18:08:04 +01:00
Craig Andrews
dee12db50a getResource can throw IllegalArgumentException
Class.getResource, ClassLoader.getResource, and ClassLoader.getSystemResource will throw IllegalArgumentException if a malformed URL is provided to them.

According to its javadoc, resolveURL should return null if not resolvable, so catch the IllegalArgumentException and return null.
2021-02-25 17:55:24 +01:00
Juergen Hoeller
e53cce0778 Allow AOP proxies to be created using the original ClassLoader
Closes gh-26601
2021-02-25 17:48:01 +01:00
Rossen Stoyanchev
3ec0452fed Dedicated, "_"-prefixed log category for request mappings
Closes gh-26539
2021-02-24 09:36:43 +00:00
Johnny Lim
dfc8406917 Polish contribution
See gh-26462
Closes gh-26586
2021-02-22 11:05:25 +01:00
Juergen Hoeller
9417975f66 Nullability refinements
See gh-26462
2021-02-16 08:51:42 +01:00
Juergen Hoeller
f48c3d9b67 Document ASM version as 9.x (effectively 9.1 at present) 2021-02-16 00:09:10 +01:00
Stephane Nicoll
582559dd9e Polish "Allow customer resolver and property sources"
See gh-26462
2021-02-15 16:53:18 +01:00