You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2024/10/29 14:38:01 UTC
(groovy) branch GROOVY-8283 updated (c880517094 -> fe14c7f5c9)
This is an automated email from the ASF dual-hosted git repository.
emilles pushed a change to branch GROOVY-8283
in repository https://gitbox.apache.org/repos/asf/groovy.git
omit c880517094 propagate sender class for `getProperty` and `setProperty`
omit 8324f8b8f8 GROOVY-8283: field hides setter of super class (not interface)
omit c9b6ec2828 GROOVY-8283: field hides getter of super class (not interface)
add 246ca1ef10 Bump codecov/codecov-action from 3 to 4
add 2b0dcc577a GROOVY-11364: STC: propagate receiver generics to candidate return types
add 0cead05ece Fix description of Observable example code.
add 5ed827654a prevent errant script
add f5914b9e76 propagate sender class for `getProperty` and `setProperty`
add bbe4557ca3 avoid GrapeIvy as mentioned class (pre-work for replacing/making optional GrapeIvy)
add 4de9597dde minor refactor: don't cache inner classes for the purpose of default import resolving
add 3164bbd5a1 minor refactor: don't cache inner classes for the purpose of default import resolving
add 950f397ed3 minor refactor: replace deprecated method usage
add fcec693e51 GROOVY-11368: STC: store parameter inferred type, except self-type param
add 0d56d711d1 GROOVY-11369: STC: map entry before non-public access method
add 8ba8e8264f GROOVY-11223: STC: create setter access error
add 14bb43a295 GROOVY-11370: add test case
add 131992c98e GROOVY-11373: SC: cross-package direct target of package-private method
add ea129d305b GROOVY-11372: STC: write property via extension method
add fd42b938de GROOVY-11372: STC: read-only property via extension method
add e15f8fce2a Enable micronaut joint validation build
add 26851b8757 Bump com.gradle.develocity from 3.17.2 to 3.17.3
add 580aee1d0f GROOVY-11374: handle type argument(s) and dynamic or non-identifier name
add b3142a3c1a GROOVY-11376: SC: field write for map-based class
add d54ca19ac4 GROOVY-10378: coerce iterable to array or collection
add 9e461c68df Ignore gradle-wrapper.jar
add 7674de6f30 Remove gradle-wrapper.jar
add 9be17090a8 Bootstrap gradle
add 45644abae9 Bootstrap gradle
add 7ea128ee01 Restore gradle-wrapper.jar
add f30978567e GROOVY-10380: return getter generated later by default argument(s)
add 5c668fcb61 GROOVY-11381: return getter from interface (default method)
add 9b9389384f fix typo
add 55ababc445 Disable micronaut joint validation build for now
add ea4b1efad7 Bump com.gradle.develocity from 3.17.3 to 3.17.4
add 0e8718d6ba GROOVY-5585: interface implicit super class
add 1a31a9265a classgen: refactor `isGroovyObject`
add 5ddc1a0a0e GROOVY-11386: STC: closure method and property precedence
add 84ac5193a7 GROOVY-11384: STC: map property for implicit-this within closure
add ef4c711ef7 GROOVY-11367, GROOVY-11387: STC: entry or field for property of map type
add e7dc2e66d3 fix for `inSamePackage`
add ba984b19e5 GROOVY-11387: STC: class field or property of map-based type
add 1fea5f7561 Gradle 8.8
add 14a9be52ad Update gradle_version
add be19a80a3b GROOVY-11394: STC: check closure call for zero, default(s), and variadic
add ff767b9cdd GROOVY-11386: STC: closure method or property within static context
add 030af1d745 Minor refactor: eliminate duplicated code
add ce3eaaa0de Minor refactor: replace switch-case with binary search
add 8b5dbb91d8 GROOVY-11395: Bump jackson to 2.17.1
add 3e10b8ae34 GROOVY-11396: Bump picocli to 4.7.6
add 26df0e92ac Update verification metadata
add 73e1c85847 Enable micronaut joint validation build
add 5d79b420cf Bump com.github.jk1.dependency-license-report from 2.7 to 2.8
add 8e5f55074c Update verification metadata
add a019862d1c Test on JDK 22 and update JDK 23 EA
add 98b0722836 GROOVY-11339: `@AutoImplement`: don't implement default argument methods
add fd57c45673 Add distributionSha256Sum
add 19fdae9132 GROOVY-11397: add test case
add cfc2a9c298 Minor refactor: replace binary search with switch-case
add e2d2128fb4 GROOVY-11398: Bump javaparser to 3.26.0
add b8cc79e453 Update verification metadata
add 91edb3284d GROOVY-11393: STC: track class or object for call or property receiver
add 44d30ee894 GROOVY-11399: STC: `getDelegate()`, `getOwner()`, `getThisObject()` type
add 040469089c GROOVY-11400: STC: propagate closure parameter information for variables
add baf06b5186 GROOVY-11401: STC: don't continue member search after map-based receiver
add 9d6b551a76 GROOVY-11367: map property precedence: put before write non-public field
add 8505bef165 GROOVY-11367: map property precedence -- public getter before map lookup
add 833c307f88 GROOVY-11367: map property precedence: `metaClass` member before get/put
add ef0d496b8c Bump com.gradle.develocity from 3.17.4 to 3.17.5
add 282c95e084 GROOVY-11367: map property precedence: put before call non-public setter
add 73880f5e69 Bump org.jfrog.buildinfo:build-info-extractor-gradle from 5.2.0 to 5.2.1
add d9499ecdf9 Replace Java-style array declaration
add 3e91751ada Trivial refactor: replace `StringBuffer` with `StringBuilder`
add f9a2bef166 Trivial refactor: replace `while` with enhanced `for`
add 9b7f70d94d Trivial refactor: remove redundant arguments
add 129c7e1354 Trivial refactor: remove unnecessary casting
add 402788d31d GROOVY-11055: Support lambda expression as named value
add 3baa1f96fb Add a hook to handle comment
add fbe262b8c7 Refine hook
add ca93d95e44 GROOVY-10993: Add CycloneDX SBOM files
add 8bd0056b10 GROOVY-11404: Bump asciidoctorj-pdf to 2.3.17
add db5748e9ca GROOVY-11405: Bump japicmp to 0.4.3
add 492b91aedc GROOVY-11406: Make Console.prefs public accessible
add 01dd4e443a Update verification metadata
add 814f0103a5 GROOVY-11407: Bump spotbugs to 4.8.5
add 3389a0b9af GROOVY-11408: Bump commons-cli to 1.8.0
add 13f14c2b80 Avoid compiling regex repeatedly
add 72f3295ca9 Minor refactor
add 0b9fd8d94a minor items
add 8c6f1a7067 GROOVY-11409: package or import annotations apply to top-level class(es)
add f96d1587fe leverage `String#isBlank` and `CharSequence#isEmpty`
add 43df77319a `CharSequence#isEmpty` is 15+
add fb2084ddb5 Bump com.gradle.common-custom-user-data-gradle-plugin
add 080277e23d GROOVY-11403: STC: map property precedence: entry before method (`this`)
add 771b04fcb7 GROOVY-11402: STC: map property precedence of `this.name` within closure
add e94a196062 GROOVY-11403: STC: map property precedence: entry before method (`this`)
add 93f0d096c5 GROOVY-11403: STC: map property precedence: entry before super field
add 8716fa1caa trivial refactor: remove findbugs warning
add e6b9133726 update dependency metadata
add 4a60c3c00b GROOVY-11383: STC: connect generics from primitive types to `Comparable`
add defefcb998 STC: method match error for primitive receiver
add d67c1d6c37 GROOVY-11385: STC: `Type::new` for abstract class is impossible
add 0e33c73ee4 GROOVY-11413: interfaces and modifiers of array class
add e6415953ea minor items
add 77a10a2c8d Trivial refactoring: replace `matches` with `equals`
add c222d71969 GROOVY-11415: Tweak bytecode for identity
add a396b0f6d5 Bump org.jfrog.buildinfo:build-info-extractor-gradle from 5.2.1 to 5.2.2
add 28bf44dfa0 Update verification metadata
add 5c78eaf3fe Refine configuration for incremental compilation
add 8feb2e370a GROOVY-11416: Bump antlr to 4.13.1.4
add d977c2b9c9 GROOVY-11417: Bump antlr to 4.13.1.5
add ea8c2d4320 Trivial refactoring: eliminate redundant check
add 00122a1d82 minor refactoring
add 35be169b6c GROOVY-11418: Bump hsqldb to 2.7.3 (test dependency)
add df445122dd GROOVY-11419: Bump slf4j to 2.0.13 (test and standard install dependency)
add 05d35a4286 Bump commons-net to 3.11.1 (performance test dependency)
add c39976a2d0 GROOVY-11420: Bump jqwik to 1.8.5 (test dependency)
add b48b0830db GROOVY-11421: Bump logback-classic to 1.5.6 (test dependency)
add 5a315d70b7 GROOVY-11422: Bump testng to 7.10.2
add 05f9dc0bd0 GROOVY-11424: Bump spotbugs to 4.8.6
add b8619d378e GROOVY-11423: Bump checkstyle to 10.17.0 (build dependency)
add 3a76745e62 GROOVY-11425: Bump gson to 2.11.0 (test dependency)
add 192afc661b remove checkstyle warnings
add 8267e96ed2 remove checkstyle warnings
add e75eb353f5 update dependency metadata
add b1a0b82b37 GROOVY-11426: Bump javaparser to 3.26.1
add eb8448f0f7 Update JsonTokenType.java
add c4b0f87fb0 GROOVY-11414: add test case
add 7aff28a27b GROOVY-11427: STC: `Class<T>` receiver only matches static method of `T`
add 4bb0e11612 GROOVY-10095, GROOVY-11371: cast `null` to primitive type
add eedf3a09a3 refactor checking
add fb954ba542 GROOVY-11375: STC: binary operator handling
add d3c07b8416 GROOVY-11429: Bump junit to 5.10.3
add 5ec593d588 GROOVY-11415: Tweak bytecode for identity
add 9af3820ce4 refactor checks for cast and null
add 08e1e8d590 GROOVY-11371: STC: assignment or typecast to primitive array
add fb15cc5bcc Minor refactor: rewrite `getCallingClass` with `StackWalker`
add 1002af2ec6 Bump org.sonarqube from 5.0.0.4638 to 5.1.0.4882
add 491db13997 GROOVY-11433: Bump jackson to 2.17.2
add 0ea97b0888 GROOVY-11435: Bump asciidoctorj-diagram to 2.3.1
add 364a68891b Update verification metadata
add 9e1f862113 GROOVY-11436: [GINQ] Some non-ascii characters in ascii table can not align correctly in console
add da9328cbc3 GROOVY-11436: avoid unnecessary call to `toArray`
add 192ac860cd GROOVY-11436: extract common variable `separator`
add c773e04ce4 GROOVY-11436: trivial refactor and refine test
add 95e4dbfbea GROOVY-10359: STC: limit `char` assign to: `Character`, `char`, or `int`
add 65ce840a7c GROOVY-11348: STC: check loss of precision for `(short) 1234` literals
add 37021a0089 GROOVY-11412: SC: inner class getProperty, not outer class bridge method
add 07dfd87ff5 minor items
add 90ac6be3c2 Bump org.jfrog.buildinfo:build-info-extractor-gradle from 5.2.2 to 5.2.3
add 53f9c69901 mark 2.4.x as unsupported
add 74db75398b GROOVY-11441: Bump gradle to 8.9
add 265b49f25f GROOVY-11436: refine check for characters with full width
add b2072200a9 bump dependency metadata
add f8e2f9eb5d GROOVY-11443: Support multiple Requires/Ensures/Invariant annotations in groovy-contracts
add caaf68c783 Bump com.gradle.develocity from 3.17.5 to 3.17.6
add a16f1a9ce6 GROOVY-11432: Support method references/method pointers in annotation attributes
add f00b8810ce Update gradle/actions action to v4
add c8011e8abb GROOVY-11452: Bump asciidoctorj-pdf to 2.3.18
add 37806c955f Disable micronaut joint validation build for now
add 59ac4d9960 Update verification metadata
add 2b74feb636 GROOVY-11119, GROOVY-11451: SC: map ctor: direct target setter overloads
add c8adb7d7d9 Bump com.github.jk1.dependency-license-report from 2.8 to 2.9
add d74ba45a8e Bump com.gradle.develocity from 3.17.6 to 3.18
add f46103d31b Bump org.jfrog.buildinfo:build-info-extractor-gradle from 5.2.3 to 5.2.4
add 7f5f7d9ea4 GROOVY-11415: Tweak bytecode for identity
add ef9b65004b GROOVY-11455: Bump junit to 5.11.0
add bebae71c3e Update verification metadata
add 96507807a8 GROOVY-11456: Bump gradle to 8.10
add 697e4591af Trivial refactor: reuse `hasAnnotation`
add 2b7e779bd1 Trivial refactor: use enhanced `for` loop
add b99c9ce33b Bump org.jfrog.buildinfo:build-info-extractor-gradle from 5.2.4 to 5.2.5
add ef3fdc5b21 GROOVY-9873: use class loader of SAM type for proxy creation
add a425cc241f Revert "GROOVY-11415: Tweak bytecode for identity"
add defa90ac96 Add `==>` to "Operator precedence" in docs
add 9a72587452 GROOVY-11458: Bump javaparser to 3.26.2
add 0b3000903c GROOVY-11460: Bump slf4j to 2.0.16 (test and standard install dependency)
add 4da59302cf GROOVY-11461: Bump logback-classic to 1.5.7 (test dependency)
add 202771a873 GROOVY-11462: Bump Codenarc to 3.5.0-groovy-4.0 (build dependency)
add bbb8c3ff97 GROOVY-11463: Bump ant version to 1.10.15
add 4f1a7858ff GROOVY-11464: Bump commons-cli to 1.9.0
add f83c8cb3f0 avoid codenarc warning
add 68bffa2b0c GROOVY-11465: Bump jqwik to 1.9.0 (test dependency)
add 4812550a7d GROOVY-11466: Bump checkstyle to 10.18.1 (build dependency)
add ee764abd15 update dependency metadata
add 77276eff5f GROOVY-11467: SC: super interface method reference from an abstract type
add 35478b7e20 GROOVY-11450: STC: nested conditional assignments
add 6e6f304643 GROOVY-11457: STC: `try`/`catch`/`finally` conditional assignments
add a2e8460a0f GROOVY-11469: Empty execute method in groovy.sql.Sql
add 0336980ae7 GROOVY-11469: Empty execute method in groovy.sql.Sql
add 210ae70f6a update dependency metadata
add f40842b771 GROOVY-11448: STC: `subList` bounds check
add 426a85c85b Do not use common ForkJoinPool on startup
add 092c0c0769 GROOVY-11471: STC: closure shared variable assignment reference typecast
add 738fe8e9aa GROOVY-11353: STC: `def var = null; var = 0` requires wrapper type
add b06e06fcb6 use import instead of fully qualified classname
add a2ec54ca8a remove unused file
add 3766af8848 formatting
add 76557a0434 GROOVY-11473: Bump log4j2 version to 2.24.0 (test dependency)
add b0ca904bb4 GROOVY-11472: Bump logback-classic to 1.5.8 (test dependency)
add ba873c5390 update dependency metadata
add 35ee676251 GROOVY-11366: STC: implicit-`this` closure field call
add dc3053779f GROOVY-11474: STC: re-check types for vars assigned within `while` loops
add 0ae468c0e3 simplify by only running from Groovy 3 up
add e1c008e08a support also providing 5.0.x versions
add 29f5a1eb0c prettier output formatting
add 899f8d8841 GROOVY-11366: STC: implicit-`this` closure field call (pt.2)
add 22d10dbedc GROOVY-11459: MD5 is already an insecure hash algorithm, replacing it with SHA256 i… (#2112)
add 8aa0b919b8 GROOVY-11459: configurable hashing algorithm (additional refactoring)
add f50ce0c1de GROOVY-8600, GROOVY-11366: SC: implicit-`this` closure field call
add dcfe41d8a5 GROOVY-5881, GROOVY-6324: defer to metaclass for closure call
add 195541397f GROOVY-5881, GROOVY-6324: STC: implicit ".call" for property expression
add 77dc80a751 transform callable property
add 168bb9bc07 cast implicit property and fix types of within-closure `this` conversion
add 59b02b54d8 GROOVY-11480: SC: check for `Type.this.name` within lambda
add 6312fec762 GROOVY-10920: SC: convert `void` and non-primitive operands to `boolean`
add 92b9bf430f GROOVY-11478: Enable GroovyClassLoader to be ParallelCapable
add 754d81986a GROOVY-11301, GROOVY-11365: SC: method reference to private or protected
add 2930ead60a add `getNestHost(ClassNode)`
add 5e6bf46183 GROOVY-11481: package-private anonymous inner class
add 9793c9c2cc GROOVY-5619, GROOVY-5649: SC: remove legacy pathway
add 5b18914b36 GROOVY-9611, GROOVY-11481: same-package reflective access to AIC's field
add 04e8f44132 GROOVY-10687: populate nest members attribute for inner class w/ closure
add c42a509f64 GROOVY-10687: SC: replace access bridge methods with direct field access
add 2efafbade1 update tools-ide.adoc and fix dead link to IntelliJ IDEA's groovy docs
add 7b093f9b6f Bump com.gradle.develocity from 3.18 to 3.18.1
add 20dfcc69aa GROOVY-11484: Downgrade asciidoctorj-diagram to 2.2.10 due to errors
add 642a7532d7 GROOVY-10687: SC: replace access bridge methods with direct method calls
add 0c2ed94544 GROOVY-10687: SC: replace access bridge methods with direct construction
add 7a7e7b2ef8 GROOVY-11479: STC: closure or lambda parameter type must remain mutable
add 7576b86fd5 GROOVY-11258: parameter subtyping: select most-specific overload
add cd9377f800 package-private access bridge
add a98c5256ab GROOVY-11485: default constructor: error for super constructor not found
add 8c18826393 GROOVY-11483: within special constructor call is a static context
add c6d0cb5419 GROOVY-11453: SC: `o*.name` or `o*.name()` is `null` for `null` receiver
add aa298337da GROOVY-11274: STC: check implicit super class constrctor call
add b1d9caca2d update restlet repository
add 8873fa5c3e GROOVY-11451: add test case
add 6c31727fb7 GROOVY-11181: STC: include parameter type in error
add 485e089031 GROOVY-8566: STC: support multi-dimensional array list expr initializers
add 1bb575f2ef GROOVY-11309: SC: skip `ScriptBytecodeAdapter.createList` for empty list
add a14109dd56 GROOVY-11309: SC: skip `ScriptBytecodeAdapter.createMap` for empty map
add 02ac82f927 GROOVY-8551: java-style multi-dimensional array initializers
add 379ad88129 fix: slashy string doc
add cdb69c922e GROOVY-11288: do not load assignment expression value for expr statement
add 49057f0826 GROOVY-11288: use operand stack (no temp variable) for simple assignment
add 1dfc6cd271 GROOVY-11286: do not load `null` for void method return for statement
add 6371ceaeea GROOVY-11491: Add support for join and group by in ginq
add d782857e68 Add missing license header
add 898cedba27 GROOVY-11494: Bump gradle to 8.10.2
add 7b070d8260 GROOVY-11286: optimize void static method return in expression statement
add 338929cefc GROOVY-11286: optimize void method return in expression statement (safe)
add 2323b8b704 GROOVY-11286, GROOVY-11453: optimize void method in expression statement
add cef611c2d2 GROOVY-11305: STC: support for-each loop for implicitly-`Iterable` types
add ab5a811f5b GROOVY-11440: add test case
add a8188364fa GROOVY-11490: STC: check `null` return of lambda
add bb453a22ec Fix github action build
add 204e3e43e8 GROOVY-11497: Bump asm to 9.7.1
add ddb9ea8c0d GROOVY-11498: Bump junit to 5.11.2
add f8f84436bd GROOVY-11499: Bump jackson to 2.18.0
add dd574a3bbc GROOVY-11500: Bump japicmp to 0.4.4
add 48c8720c04 Update verification metadata
add 3e3475de6e GROOVY-11497: add JDK24 constant
add a830524f20 Fix typo
add c84ff749ce GROOVY-11499: Bump jackson-databind to 2.18.0
add 5560c47095 GROOVY-11501: Bump log4j2 to 2.24.1
add 31494b375e GROOVY-11502: Bump asciidoctorj-pdf to 2.3.19
add 2cb0db8bac GROOVY-11503: Bump asciidoctorj-diagram to 2.2.17
add 58380fbd3e GROOVY-11504: Bump jqwik to 1.9.1
add c66819733e GROOVY-11505: Bump logback to 1.5.11
add 503f0a21f4 GROOVY-11506: Bump checkstyle to 10.18.2
add 73fd174739 Update verification metadata
add 5750f2cd0a GROOVY-11367, GROOVY-11369, GROOVY-11507: "class" and "empty" properties
add c0622aafd5 update dependency metadata
add 932ed319a0 trivial formatting
add 0a197f1fe6 GROOVY-11510: Bump junit5 to 5.11.3
add ee9db13a25 GROOVY-11511: Bump logback to 1.5.12
add 9af8bf8ed4 Update verification metadata
add 904347c8b3 Refine `NamedTuple`
add 7c835a1ede GROOVY-5106, GROOVY-11508: re-implement trait with new type args warning
add 4cf3726537 Eliminate unnecessary boxing and unboxing
add 3ac88f0fec Remove unnecessary `volatile` (`ListHashMap` is not thread-safe)
add ff62bbb29b Refine `ListHashMap`: Set initial capacity of map
add bfbdb061a9 Add missing `@Override`
add 1ad5b8f160 Flip operands of `equals` to avoid potential NPE
add d5c3255083 Declare array variable with Java stile
add d5760cf0bc Flip operands of equals to avoid potential NPE
add 65506f4c58 GROOVY-9306: accept trailing comma for constants-only `enum` declaration
new fe14c7f5c9 GROOVY-8283: field hides getter or setter of super class (not interface)
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (c880517094)
\
N -- N -- N refs/heads/GROOVY-8283 (fe14c7f5c9)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/SECURITY.md | 24 +-
.github/workflows/gradle-wrapper-validation.yml | 39 -
.github/workflows/grails-joint-validation.yml | 2 +-
.github/workflows/groovy-build-coverage.yml | 4 +-
.github/workflows/groovy-build-test.yml | 11 +-
.github/workflows/groovy-rat-check.yml | 2 +-
.github/workflows/micronaut-joint-validation.yml | 28 +-
.gitignore | 13 +-
build-logic/build.gradle | 3 +-
.../main/groovy/org.apache.groovy-internal.gradle | 2 +
.../org.apache.groovy-published-library.gradle | 20 +
.../groovy/gradle/PerformanceTestSummary.groovy | 5 +-
.../groovy/gradle/PerformanceTestsExtension.groovy | 18 +-
build.gradle | 4 +-
gradle.properties | 2 +-
gradle/verification-metadata.xml | 552 ++++++--
gradle/wrapper/gradle-wrapper.jar | Bin 61574 -> 43583 bytes
gradle/wrapper/gradle-wrapper.properties | 3 +-
gradlew | 34 +-
gradlew.bat | 22 +-
settings.gradle | 4 +-
src/antlr/GroovyLexer.g4 | 7 +-
src/antlr/GroovyParser.g4 | 64 +-
src/main/groovy/groovy/grape/GrapeIvy.groovy | 4 +-
.../org/codehaus/groovy/tools/GrapeMain.groovy | 18 +-
.../groovy/beans/BindableASTTransformation.java | 6 +-
.../groovy/beans/VetoableASTTransformation.java | 6 +-
.../groovy/grape/GrabAnnotationTransformation.java | 138 +-
src/main/java/groovy/grape/Grape.java | 20 +-
src/main/java/groovy/lang/GroovyClassLoader.java | 118 +-
.../java/groovy/lang/GroovyRuntimeException.java | 2 +-
src/main/java/groovy/lang/GroovyShell.java | 2 +-
src/main/java/groovy/lang/MetaClassImpl.java | 201 +--
src/main/java/groovy/namespace/QName.java | 10 +-
.../groovy/transform/builder/ExternalStrategy.java | 6 +-
.../options/ImmutablePropertyHandler.java | 46 +-
src/main/java/groovy/util/GroovyScriptEngine.java | 2 +-
.../groovy/ast/tools/AnnotatedNodeUtils.java | 3 +-
.../apache/groovy/ast/tools/ClassNodeUtils.java | 107 +-
.../apache/groovy/ast/tools/ExpressionUtils.java | 97 +-
.../groovy/ast/tools/ImmutablePropertyUtils.java | 13 +-
.../apache/groovy/ast/tools/MethodNodeUtils.java | 51 +
.../apache/groovy/ast/tools/VisibilityUtils.java | 2 +-
.../apache/groovy/parser/antlr4/AstBuilder.java | 226 ++-
.../java/org/codehaus/groovy/ast/ClassHelper.java | 1 +
.../java/org/codehaus/groovy/ast/ClassNode.java | 63 +-
.../java/org/codehaus/groovy/ast/FieldNode.java | 2 +-
.../groovy/ast/MixinASTTransformation.java | 2 +-
.../java/org/codehaus/groovy/ast/ModuleNode.java | 11 +-
.../groovy/ast/decompiled/DecompiledClassNode.java | 2 +-
.../codehaus/groovy/ast/expr/ArrayExpression.java | 109 +-
.../groovy/ast/expr/DeclarationExpression.java | 13 +-
.../groovy/ast/expr/MethodCallExpression.java | 46 +-
.../org/codehaus/groovy/ast/tools/BeanUtils.java | 2 +-
.../codehaus/groovy/ast/tools/ClosureUtils.java | 4 +-
.../codehaus/groovy/ast/tools/GeneralUtils.java | 80 +-
.../groovy/classgen/AnnotationVisitor.java | 2 +-
.../groovy/classgen/AsmClassGenerator.java | 142 +-
.../org/codehaus/groovy/classgen/EnumVisitor.java | 31 +-
.../codehaus/groovy/classgen/ExtendedVerifier.java | 8 +-
.../codehaus/groovy/classgen/GeneratorContext.java | 38 +-
.../classgen/InnerClassCompletionVisitor.java | 27 +-
.../groovy/classgen/InnerClassVisitor.java | 2 +-
.../groovy/classgen/VariableScopeVisitor.java | 4 +-
.../org/codehaus/groovy/classgen/Verifier.java | 14 +-
.../classgen/asm/BinaryExpressionHelper.java | 121 +-
.../asm/BinaryExpressionMultiTypeDispatcher.java | 28 +-
.../groovy/classgen/asm/ClosureWriter.java | 4 +-
.../codehaus/groovy/classgen/asm/CompileStack.java | 28 +-
.../groovy/classgen/asm/InvocationWriter.java | 135 +-
.../codehaus/groovy/classgen/asm/OperandStack.java | 2 +-
.../classgen/asm/StatementMetaTypeChooser.java | 3 +-
.../groovy/classgen/asm/StatementWriter.java | 18 +-
.../groovy/classgen/asm/WriterController.java | 18 +-
.../asm/sc/AbstractFunctionalInterfaceWriter.java | 25 +-
.../classgen/asm/sc/StaticInvocationWriter.java | 471 +++----
.../asm/sc/StaticPropertyAccessHelper.java | 10 +-
...icTypesBinaryExpressionMultiTypeDispatcher.java | 222 ++-
.../classgen/asm/sc/StaticTypesCallSiteWriter.java | 287 ++--
.../classgen/asm/sc/StaticTypesLambdaWriter.java | 16 +-
...StaticTypesMethodReferenceExpressionWriter.java | 30 +-
.../classgen/asm/sc/StaticTypesTypeChooser.java | 15 +-
.../codehaus/groovy/control/ClassNodeResolver.java | 2 +-
.../codehaus/groovy/control/CompilationUnit.java | 59 +-
.../groovy/control/CompilerConfiguration.java | 19 +-
.../groovy/control/PlaceholderVisitor.java | 8 +-
.../codehaus/groovy/control/ResolveVisitor.java | 95 +-
.../groovy/control/StaticImportVisitor.java | 2 +-
.../groovy/reflection/MixinInMetaClass.java | 2 +-
.../groovy/reflection/ReflectionUtils.java | 25 +-
.../groovy/runtime/ArrayGroovyMethods.java | 4 +-
.../groovy/runtime/DefaultGroovyMethods.java | 69 +-
.../codehaus/groovy/runtime/MetaClassHelper.java | 4 +-
.../groovy/runtime/ResourceGroovyMethods.java | 6 +-
.../groovy/runtime/ScriptBytecodeAdapter.java | 6 +-
.../groovy/runtime/StringGroovyMethods.java | 7 +-
.../runtime/metaclass/ClosureMetaMethod.java | 2 +-
.../typehandling/DefaultTypeTransformation.java | 163 ++-
.../runtime/typehandling/GroovyCastException.java | 45 +-
.../org/codehaus/groovy/tools/DgmConverter.java | 6 +-
.../groovy/tools/javac/JavaStubGenerator.java | 13 +-
.../groovy/tools/javac/JavacJavaCompiler.java | 2 +-
.../transform/AutoCloneASTTransformation.java | 6 +-
.../transform/AutoImplementASTTransformation.java | 76 +-
.../transform/BaseScriptASTTransformation.java | 2 +-
.../transform/DelegateASTTransformation.java | 13 +-
.../EqualsAndHashCodeASTTransformation.java | 2 +-
.../ExternalizeMethodsASTTransformation.java | 16 +-
.../groovy/transform/NewifyASTTransformation.java | 2 +-
.../transform/PackageScopeASTTransformation.java | 2 +-
.../transform/RecordTypeASTTransformation.java | 2 +-
.../groovy/transform/SealedASTTransformation.java | 2 +-
.../transform/SynchronizedASTTransformation.java | 2 +-
.../transform/ToStringASTTransformation.java | 2 +-
.../TupleConstructorASTTransformation.java | 2 +-
.../sc/StaticCompilationMetadataKeys.java | 29 +-
.../transform/sc/StaticCompilationVisitor.java | 69 +-
.../transformers/BooleanExpressionTransformer.java | 4 +-
.../transformers/ConstructorCallTransformer.java | 19 +-
.../sc/transformers/ListExpressionTransformer.java | 60 +-
.../sc/transformers/MapExpressionTransformer.java | 54 +
.../MethodCallExpressionTransformer.java | 118 +-
.../PropertyExpressionTransformer.java | 27 +
.../transformers/StaticCompilationTransformer.java | 21 +-
.../StaticMethodCallExpressionTransformer.java | 10 +-
.../VariableExpressionTransformer.java | 8 +-
.../groovy/transform/stc/DelegationMetadata.java | 9 +-
.../codehaus/groovy/transform/stc/Receiver.java | 39 +-
.../transform/stc/StaticTypeCheckingSupport.java | 189 ++-
.../transform/stc/StaticTypeCheckingVisitor.java | 1022 ++++++++------
.../transform/tailrec/StatementReplacer.java | 6 +
.../java/org/codehaus/groovy/util/ListHashMap.java | 5 +-
.../org/codehaus/groovy/vmplugin/v8/Java8.java | 4 +-
.../vmplugin/v8/PluginDefaultGroovyMethods.java | 4 +-
.../org/codehaus/groovy/vmplugin/v8/Selector.java | 11 +-
.../groovy/vmplugin/v8/TypeTransformers.java | 21 +-
.../codehaus/groovy/vmplugin/v9/ClassFinder.java | 32 +-
.../org/codehaus/groovy/vmplugin/v9/Java9.java | 57 +-
src/spec/doc/core-gdk.adoc | 4 +-
src/spec/doc/core-operators.adoc | 1 +
src/spec/doc/core-syntax.adoc | 2 +-
src/spec/doc/design-patterns-in-groovy.adoc | 2 +-
src/spec/doc/tools-ide.adoc | 2 +-
src/spec/test/RecordSpecificationTest.groovy | 4 +-
.../test/builder/ObjectGraphBuilderTest.groovy | 19 +-
src/spec/test/gdk/WorkingWithArraysTest.groovy | 41 +-
.../test-resources/bugs/GROOVY-11055.groovy | 19 +-
src/test-resources/core/Array_01x.groovy | 19 +-
src/test-resources/core/EnumDeclaration_01.groovy | 76 +-
src/test-resources/core/EnumDeclaration_02.groovy | 215 ++-
src/test-resources/core/EnumDeclaration_03.groovy | 48 +-
src/test-resources/core/EnumDeclaration_04.groovy | 9 +-
src/test-resources/core/EnumDeclaration_05.groovy | 5 +-
...aration_05.groovy => EnumDeclaration_06.groovy} | 3 +-
src/test-resources/core/IdenticalOp_01x.groovy | 89 +-
src/test/gls/enums/EnumTest.groovy | 25 +-
src/test/gls/innerClass/InnerClassTest.groovy | 199 ++-
src/test/groovy/ListTest.groovy | 4 +-
src/test/groovy/MapTest.groovy | 217 ++-
src/test/groovy/bugs/Groovy11203.groovy | 2 +-
.../bugs/{Groovy4365.groovy => Groovy5267.groovy} | 14 +-
src/test/groovy/bugs/Groovy5267Bug.groovy | 50 -
src/test/groovy/bugs/Groovy6954.groovy | 38 +
src/test/groovy/bugs/Groovy8065.groovy | 17 -
src/test/groovy/bugs/Groovy8169.groovy | 49 -
src/test/groovy/bugs/Groovy8283.groovy | 72 -
src/test/groovy/bugs/Groovy8446.groovy | 33 +-
.../{Groovy8600Bug.groovy => Groovy8600.groovy} | 16 +-
src/test/groovy/bugs/Groovy9007.groovy | 12 +-
src/test/groovy/bugs/Groovy9115.groovy | 42 +-
src/test/groovy/bugs/Groovy9126.groovy | 102 +-
src/test/groovy/bugs/Groovy9611.groovy | 20 +-
src/test/groovy/bugs/Groovy9873.groovy | 137 ++
src/test/groovy/grape/GrabResolverTest.groovy | 4 +-
src/test/groovy/inspect/InspectorTest.java | 2 +-
.../stc/ArraysAndCollectionsSTCTest.groovy | 316 ++++-
src/test/groovy/transform/stc/BugsSTCTest.groovy | 116 +-
.../groovy/transform/stc/ClosuresSTCTest.groovy | 526 ++++++-
.../groovy/transform/stc/CoercionSTCTest.groovy | 218 +++
.../transform/stc/ConstructorsSTCTest.groovy | 40 +-
.../stc/FieldsAndPropertiesSTCTest.groovy | 1471 +++++++++++++++-----
.../groovy/transform/stc/GenericsSTCTest.groovy | 44 +-
src/test/groovy/transform/stc/LambdaTest.groovy | 100 +-
src/test/groovy/transform/stc/LoopsSTCTest.groovy | 54 +-
.../groovy/transform/stc/MethodCallsSTCTest.groovy | 15 +-
.../transform/stc/MethodReferenceTest.groovy | 288 +++-
src/test/groovy/transform/stc/MiscSTCTest.groovy | 3 +-
.../test/groovy/transform/stc/Pojo11451.java | 11 +-
.../groovy/transform/stc/STCAssignmentTest.groovy | 1355 +++++++++---------
.../transform/stc/STCnAryExpressionTest.groovy | 22 +-
.../transform/stc/TernaryOperatorSTCTest.groovy | 4 +-
.../stc/TypeCheckingExtensionsTest.groovy | 4 +-
.../transform/stc/TypeInferenceSTCTest.groovy | 2 +-
.../transform/stc/WithSTCStandaloneTest.groovy | 77 -
src/test/groovy/transform/stc/WithSTCTest.groovy | 80 --
src/test/groovy/tree/TreeTest.groovy | 42 +-
.../groovy/parser/antlr4/GroovyParserTest.groovy | 296 ++--
.../groovy/parser/antlr4/SyntaxErrorTest.groovy | 142 +-
.../apache/groovy/parser/antlr4/TestUtils.groovy | 11 +-
.../groovy/antlr/EnumSourceParsingTest.java | 368 -----
.../org/codehaus/groovy/ast/ClassNodeTest.java | 17 +
.../ast/decompiled/support/Groovy8632Groovy.groovy | 6 +-
.../ast/expr/MethodCallExpressionTest.groovy | 62 +-
.../groovy/ast/tools/GenericsUtilsTest.groovy | 4 +-
.../classgen/FinalVariableAnalyzerTest.groovy | 42 +-
.../classgen/asm/AbstractBytecodeTestCase.groovy | 6 +-
.../groovy/classgen/asm/NestHostTests.groovy | 43 +-
.../groovy/classgen/asm/TypeAnnotationsTest.groovy | 36 +
.../ArraysAndCollectionsStaticCompileTest.groovy | 82 +-
.../classgen/asm/sc/BugsStaticCompileTest.groovy | 5 +-
.../sc/FieldsAndPropertiesStaticCompileTest.groovy | 684 ++++-----
.../asm/sc/MethodCallsStaticCompilationTest.groovy | 1 +
.../classgen/asm/sc/StaticCompilationTest.groovy | 699 ++++++----
.../asm/sc/StaticCompilationTestSupport.groovy | 56 +-
.../asm/sc/StaticCompileConstructorsTest.groovy | 18 +-
.../classgen/asm/sc/WithStaticCompileTest.groovy | 29 -
.../{Groovy6276Bug.groovy => Groovy6276.groovy} | 32 +-
.../groovy/classgen/asm/sc/bugs/Groovy7276.groovy | 47 +-
.../groovy/classgen/asm/sc/bugs/Groovy7304.groovy | 42 -
.../classgen/asm/sc/bugs/Groovy7324Bug.groovy | 74 +-
.../classgen/asm/sc/bugs/Groovy7325Bug.groovy | 12 +-
.../groovy/control/CompilerConfigurationTest.java | 4 +-
.../DefaultTypeTransformationTest.groovy | 92 +-
.../transform/AutoImplementTransformTest.groovy | 34 +-
.../groovy/transform/DelegateTransformTest.groovy | 24 +-
.../transform/TupleConstructorTransformTest.groovy | 72 +
.../groovy/transform/traitx/Groovy11508.groovy} | 27 +-
.../groovy/transform/traitx/Groovy8864.groovy} | 19 +-
.../traitx/TraitWithClosureOrLambda.groovy | 2 +-
.../groovy/vmplugin/v9/ClassFinderTest.groovy | 2 +-
subprojects/binary-compatibility/build.gradle | 2 +-
.../src/main/java/groovy/ant}/package-info.java | 4 +-
.../groovy/ant/AntProjectPropertiesDelegate.java | 2 +-
.../main/java/org/codehaus/groovy/ant/Groovyc.java | 20 +-
.../java/org/codehaus/groovy/ant/Groovydoc.java | 2 +-
.../java/org/codehaus/groovy/ant/VerifyClass.java | 2 +-
.../ast/builder/AstBuilderTransformation.java | 4 +-
.../apache/groovy/ast}/builder/package-info.java | 4 +-
.../main/groovy/groovy/console/ui/Console.groovy | 2 +-
.../groovy/console/ui/ConsoleTextEditor.java | 8 +-
.../groovy/console/ui/text/FindReplaceUtility.java | 8 +-
.../ui/text/StructuredSyntaxDocumentFilter.java | 9 +-
.../groovy/console/ui/view/BasicToolBar.groovy | 1 -
.../groovy/console/ui/view/GTKDefaults.groovy | 3 +-
.../groovy/console/ui/view/WindowsDefaults.groovy | 4 +-
.../groovy/console/ui/InteractiveShell.properties | 66 -
.../src/main/java/groovy/contracts/Ensures.java | 4 +-
.../java/groovy/contracts/EnsuresConditions.java} | 9 +-
.../src/main/java/groovy/contracts/Invariant.java | 4 +-
.../main/java/groovy/contracts/Invariants.java} | 9 +-
.../src/main/java/groovy/contracts/Requires.java | 4 +-
.../java/groovy/contracts/RequiresConditions.java} | 9 +-
.../apache/groovy/contracts/ViolationTracker.java | 5 +-
...osureExpressionEvaluationASTTransformation.java | 33 +-
.../ast/visitor/AnnotationClosureVisitor.java | 8 +-
.../ast/visitor/AnnotationProcessorVisitor.java | 76 +-
.../groovy/contracts/ast/visitor/BaseVisitor.java | 2 +-
.../classgen/asm/ContractClosureWriter.java | 5 +-
.../impl/ClassInvariantAnnotationProcessor.java | 10 +
.../common/impl/EnsuresAnnotationProcessor.java | 8 +-
.../common/impl/lc/PostconditionLifecycle.java | 12 +-
.../groovy/contracts/common/spi/Lifecycle.java | 12 +-
.../common/spi/ProcessingContextInformation.java | 8 +-
.../apache/groovy/contracts/domain/Assertion.java | 31 +-
.../groovy/contracts/domain/AssertionMap.java | 2 +-
.../groovy/contracts/domain/ClassInvariant.java | 7 +-
.../generation/AssertStatementCreationUtility.java | 6 +-
.../groovy/contracts/generation/BaseGenerator.java | 24 +-
.../generation/ClassInvariantGenerator.java | 16 +-
.../groovy/contracts/generation/Configurator.java | 8 +-
.../generation/ContractExecutionTracker.java | 13 +-
.../generation/OldVariableGenerationUtility.java | 20 +-
.../generation/PostconditionGenerator.java | 17 +-
.../generation/PreconditionGenerator.java | 13 +-
.../generation/TryCatchBlockGenerator.java | 3 +-
.../groovy/contracts/util/AnnotationUtils.java | 37 +-
.../groovy/contracts/util/ExpressionUtils.java | 7 +-
.../util/LifecycleImplementationLoader.java | 14 +-
.../groovy/contracts/domain/ContractTests.groovy | 21 +-
.../tests/pre/SimplePreconditionTests.groovy | 49 +-
.../datetime/extensions/DateTimeExtensions.java | 2 +-
.../dateutil/extensions/DateUtilExtensions.java | 2 +-
.../ginq/provider/collection/GinqAstWalker.groovy | 6 +
.../provider/collection/runtime/AbstractBound.java | 2 +-
.../collection/runtime/AsciiTableMaker.groovy | 211 +--
.../collection/runtime/ConcurrentObjectHolder.java | 2 +-
.../provider/collection/runtime/NamedTuple.groovy | 13 +-
.../collection/runtime/QueryableCollection.java | 6 +-
.../collection/runtime/WindowDefinitionImpl.java | 24 +-
.../test/org/apache/groovy/ginq/GinqTest.groovy | 69 +
.../collection/runtime/AsciiTableMakerTest.groovy | 47 +
.../collection/runtime/NamedTupleTest.groovy | 11 +
.../org/apache/groovy/antlr/GroovydocVisitor.java | 4 +-
.../tools/groovydoc/SimpleGroovyClassDoc.java | 15 +-
.../tools/groovydoc/SimpleGroovyRootDoc.java | 4 +-
.../src/main/java/groovy/jmx/GroovyMBean.java | 2 +-
.../groovy/jmx/builder/JmxBuilderModelMBean.java | 6 +-
.../java/groovy/jmx/builder/JmxEventEmitter.java | 2 +-
subprojects/groovy-json/build.gradle | 2 +-
.../java/groovy/json/DefaultJsonGenerator.java | 6 +-
.../src/main/java/groovy/json/JsonTokenType.java | 4 +-
.../apache/groovy/json/internal/CharScanner.java | 2 +-
.../groovy/jsr223/GroovyScriptEngineImpl.java | 6 +-
.../groovy/macrolib/MacroLibGroovyMethods.java | 2 +-
.../macro/matcher/ContextualClassCodeVisitor.java | 2 +-
.../groovy/macro/transform/MacroMethodsCache.java | 2 +-
.../main/java/groovy/servlet/ServletBinding.java | 4 +-
.../main/java/groovy/servlet/TemplateServlet.java | 2 +-
subprojects/groovy-sql/build.gradle | 2 +-
.../main/java/groovy/sql/GroovyResultSetProxy.java | 4 +-
.../groovy-sql/src/main/java/groovy/sql/Sql.java | 6 +-
.../groovy/sql/extensions/SqlExtensions.java | 4 +-
.../groovy-sql/src/spec/test/SqlTest.groovy | 4 +-
.../test/groovy/groovy/sql/SqlCompleteTest.groovy | 3 +-
.../swing/binding/AbstractButtonProperties.java | 11 +-
.../groovy/swing/binding/JComboBoxProperties.java | 36 +-
.../groovy/swing/binding/JComponentProperties.java | 97 +-
.../groovy/swing/binding/JScrollBarProperties.java | 11 +-
.../groovy/swing/binding/JSliderProperties.java | 11 +-
.../groovy/swing/binding/JSpinnerProperties.java | 11 +-
.../groovy/swing/binding/JTableProperties.java | 25 +-
.../swing/binding/JTextComponentProperties.java | 11 +-
.../apache/groovy/swing/binding/BindingProxy.java | 2 +-
.../groovy/swing/binding/EventTriggerBinding.java | 4 +-
.../groovy/groovy/text/SimpleTemplateEngine.java | 4 +-
.../groovy/text/TemplateExecutionException.java | 2 +-
.../groovy/groovy/text/TemplateParseException.java | 4 +-
.../main/groovy/groovy/text/XmlTemplateEngine.java | 16 +-
.../groovy/text/markup/AutoNewLineTransformer.java | 2 +-
.../groovy/groovy/text/markup/BaseTemplate.java | 2 +-
.../text/markup/MarkupBuilderCodeTransformer.java | 2 +-
.../groovy/text/markup/MarkupTemplateEngine.java | 4 +-
.../groovy/text/markup/TemplateASTTransformer.java | 2 +-
subprojects/groovy-test-junit5/build.gradle | 4 +-
.../java/groovy/junit5/plugin/JUnit5Runner.java | 2 +-
.../mock/interceptor/MockProxyMetaClass.java | 2 +-
subprojects/groovy-testng/build.gradle | 2 +-
.../src/main/java/groovy/xml/XmlNodePrinter.java | 4 +-
.../groovy/xml/slurpersupport/NodeIterator.java | 2 +-
.../streamingmarkupsupport/BaseMarkupBuilder.java | 4 +-
.../org/apache/groovy/xml/tools/DomToGroovy.java | 4 +-
subprojects/performance/build.gradle | 5 +-
subprojects/performance/src/files/pleac01.groovy | 5 +-
.../performance/src/files/pleac05_06.groovy | 5 +-
.../performance/src/files/pleac07_10.groovy | 3 +
.../performance/src/files/pleac11_15.groovy | 12 +-
.../performance/src/files/pleac16_20.groovy | 10 +-
versions.properties | 38 +-
348 files changed, 10165 insertions(+), 7278 deletions(-)
delete mode 100644 .github/workflows/gradle-wrapper-validation.yml
create mode 100644 src/main/java/org/codehaus/groovy/transform/sc/transformers/MapExpressionTransformer.java
copy build-logic/src/main/groovy/org/apache/groovy/gradle/DocAggregationExtension.groovy => src/test-resources/bugs/GROOVY-11055.groovy (73%)
copy src/test-resources/core/{EnumDeclaration_05.groovy => EnumDeclaration_06.groovy} (99%)
copy src/test/groovy/bugs/{Groovy4365.groovy => Groovy5267.groovy} (78%)
delete mode 100644 src/test/groovy/bugs/Groovy5267Bug.groovy
delete mode 100644 src/test/groovy/bugs/Groovy8169.groovy
rename src/test/groovy/bugs/{Groovy8600Bug.groovy => Groovy8600.groovy} (78%)
create mode 100644 src/test/groovy/bugs/Groovy9873.groovy
copy subprojects/groovy-test/src/test/groovy/groovy/test/GroovyTestJavadocAssertionTest.groovy => src/test/groovy/transform/stc/Pojo11451.java (80%)
delete mode 100644 src/test/groovy/transform/stc/WithSTCStandaloneTest.groovy
delete mode 100644 src/test/groovy/transform/stc/WithSTCTest.groovy
delete mode 100644 src/test/org/codehaus/groovy/antlr/EnumSourceParsingTest.java
delete mode 100644 src/test/org/codehaus/groovy/classgen/asm/sc/WithStaticCompileTest.groovy
rename src/test/org/codehaus/groovy/classgen/asm/sc/bugs/{Groovy6276Bug.groovy => Groovy6276.groovy} (68%)
delete mode 100644 src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy7304.groovy
copy src/test/{groovy/bugs/Groovy9906.groovy => org/codehaus/groovy/transform/traitx/Groovy11508.groovy} (68%)
rename src/test/{groovy/bugs/Groovy8864Bug.groovy => org/codehaus/groovy/transform/traitx/Groovy8864.groovy} (78%)
copy subprojects/{groovy-jmx/src/main/java/groovy/jmx/builder => groovy-ant/src/main/java/groovy/ant}/package-info.java (89%)
copy subprojects/{groovy-jmx/src/main/java/groovy/jmx => groovy-astbuilder/src/main/java/org/apache/groovy/ast}/builder/package-info.java (87%)
delete mode 100644 subprojects/groovy-console/src/main/resources/groovy/console/ui/InteractiveShell.properties
copy subprojects/{groovy-macro/src/main/groovy/org/codehaus/groovy/macro/runtime/Macro.java => groovy-contracts/src/main/java/groovy/contracts/EnsuresConditions.java} (85%)
copy subprojects/{groovy-macro/src/main/groovy/org/codehaus/groovy/macro/runtime/Macro.java => groovy-contracts/src/main/java/groovy/contracts/Invariants.java} (88%)
copy subprojects/{groovy-macro/src/main/groovy/org/codehaus/groovy/macro/runtime/Macro.java => groovy-contracts/src/main/java/groovy/contracts/RequiresConditions.java} (85%)
create mode 100644 subprojects/groovy-ginq/src/test/groovy/org/apache/groovy/ginq/provider/collection/runtime/AsciiTableMakerTest.groovy
(groovy) 01/01: GROOVY-8283: field hides getter or setter of super class (not interface)
Posted by em...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
emilles pushed a commit to branch GROOVY-8283
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit fe14c7f5c99fb152a9f47bd4f9869f5b6b7a5be5
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Tue Oct 29 08:48:40 2024 -0500
GROOVY-8283: field hides getter or setter of super class (not interface)
---
src/main/java/groovy/lang/MetaClassImpl.java | 43 +++++++++++++-------
src/test/groovy/bugs/Groovy8283.groovy | 60 ++++++++++++++++++++++++++++
2 files changed, 89 insertions(+), 14 deletions(-)
diff --git a/src/main/java/groovy/lang/MetaClassImpl.java b/src/main/java/groovy/lang/MetaClassImpl.java
index 427d4b4e60..09c127fe9e 100644
--- a/src/main/java/groovy/lang/MetaClassImpl.java
+++ b/src/main/java/groovy/lang/MetaClassImpl.java
@@ -1824,18 +1824,18 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
//----------------------------------------------------------------------
Tuple2<MetaMethod, MetaProperty> methodAndProperty = createMetaMethodAndMetaProperty(sender, name, useSuper, isStatic);
MetaMethod method = methodAndProperty.getV1();
+ MetaProperty prop = methodAndProperty.getV2();
- if (method == null || isSpecialProperty(name)) {
+ if (method == null || isSpecialProperty(name) || isVisibleProperty(prop, method, sender)) {
//------------------------------------------------------------------
// public field
//------------------------------------------------------------------
- MetaProperty mp = methodAndProperty.getV2();
- if (mp != null && mp.isPublic()) {
+ if (prop != null && prop.isPublic()) {
try {
- return mp.getProperty(object);
+ return prop.getProperty(object);
} catch (GroovyRuntimeException e) {
// can't access the field directly but there may be a getter
- mp = null;
+ prop = null;
}
}
@@ -1849,9 +1849,9 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
//------------------------------------------------------------------
// non-public field
//------------------------------------------------------------------
- if (mp != null) {
+ if (prop != null) {
try {
- return mp.getProperty(object);
+ return prop.getProperty(object);
} catch (GroovyRuntimeException e) {
}
}
@@ -1946,14 +1946,14 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
//----------------------------------------------------------------------
Tuple2<MetaMethod, MetaProperty> methodAndProperty = createMetaMethodAndMetaProperty(sender, name, useSuper, isStatic);
MetaMethod method = methodAndProperty.getV1();
+ MetaProperty prop = methodAndProperty.getV2();
- if (method == null || isSpecialProperty(name)) {
+ if (method == null || isSpecialProperty(name) || isVisibleProperty(prop, method, sender)) {
//------------------------------------------------------------------
// public field
//------------------------------------------------------------------
- MetaProperty mp = methodAndProperty.getV2();
- if (mp != null && mp.isPublic()) {
- return mp;
+ if (prop != null && prop.isPublic()) {
+ return prop;
}
//------------------------------------------------------------------
@@ -1976,8 +1976,8 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
//------------------------------------------------------------------
// non-public field
//------------------------------------------------------------------
- if (mp != null) {
- return mp;
+ if (prop != null) {
+ return prop;
}
}
@@ -2112,6 +2112,21 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
return "class".equals(name) || (isMap && ("empty".equals(name)));
}
+ private boolean isVisibleProperty(final MetaProperty field, final MetaMethod method, final Class<?> sender) {
+ if (!(field instanceof CachedField)) return false;
+
+ if (field.isPrivate()) return false;
+
+ Class<?> owner = ((CachedField) field).getDeclaringClass();
+ // ensure access originates within the type hierarchy of the field owner
+ if (owner.equals(sender) || !owner.isAssignableFrom(sender)) return false;
+
+ if (!field.isPublic() && !field.isProtected() && !inSamePackage(owner, sender)) return false;
+
+ // GROOVY-8283: non-private field that hides class access method
+ return !owner.isAssignableFrom(method.getDeclaringClass().getTheClass()) && !method.getDeclaringClass().isInterface();
+ }
+
private Tuple2<MetaMethod, MetaProperty> createMetaMethodAndMetaProperty(final Class sender, final String name, final boolean useSuper, final boolean isStatic) {
MetaMethod method = null;
MetaProperty mp = getMetaProperty(sender, name, useSuper, isStatic);
@@ -2772,7 +2787,7 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
//----------------------------------------------------------------------
// field
//----------------------------------------------------------------------
- if (method == null && field != null
+ if (field != null && (method == null || isVisibleProperty(field, method, sender))
&& (!isMap || isStatic // GROOVY-8065
|| field.isPublic())) { // GROOVY-11367
if (!field.isFinal()) {
diff --git a/src/test/groovy/bugs/Groovy8283.groovy b/src/test/groovy/bugs/Groovy8283.groovy
new file mode 100644
index 0000000000..96956770ad
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy8283.groovy
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package groovy.bugs
+
+import org.junit.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+final class Groovy8283 {
+
+ @Test
+ void testReadFieldPropertyShadowing() {
+ def shell = new GroovyShell()
+ shell.parse '''package p
+ class A {}
+ class B {}
+ class C {
+ protected A foo = new A()
+ A getFoo() { return foo }
+ }
+ class D extends C {
+ protected B foo = new B() // hides A#foo; should hide A#getFoo in subclasses
+ }
+ '''
+ assertScript shell, '''import p.*
+ class E extends D {
+ void test() {
+ assert foo.class == B
+ assert this.foo.class == B
+ assert this.@foo.class == B
+ assert this.getFoo().getClass() == A
+
+ def that = new E()
+ assert that.foo.class == B
+ assert that.@foo.class == B
+ assert that.getFoo().getClass() == A
+ }
+ }
+
+ new E().test()
+ assert new E().foo.class == A // not the field from this perspective
+ '''
+ }
+}