-
-
Notifications
You must be signed in to change notification settings - Fork 963
feat!: Update to Spring 6, Boot 3 #13545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4a34451
feat(spring6)!: Move from javax.servlet to jakarta.servlet
matrei 425112d
chore: Update license headers
matrei 3064d74
fix(spring6): Simplify BeanCreationProfilingPostProcessor
matrei 666942f
fix(spring6): Remove deprecated OptimizedAutowireCapableBeanFactory
matrei 0f4ff9e
fix(spring6): Remove grails-web-fileupload project
matrei fab2c0f
fix(spring6): Deprecate MockHttpServletResponse
matrei cbc4157
fix(spring6): Replace removed NestedIOException
matrei 6467f81
fix(spring6): Add missing classes for annotation reading
matrei f0719bd
fix(spring6): Config loads correctly to Spring profiles
matrei 82ea455
test: Set `@PendingFeature` on tests that uses `grails-plugin-convert…
matrei 8a274e0
test: Disable tests using `grails-gsp`
matrei ed70c1e
test: Change Spring profile property in test config
matrei 6779052
fix(deps): Update Spring to 6.0.22
matrei c6505df
fix(deps): Update Tomcat to 10.1.25
matrei 9da5c94
fix(deps): Update Spring Boot to 3.1.12
matrei 4c4a02c
feat!: Update to and compatible with Spring 6.1, Boot 3.2
matrei bd7b7d6
test(deps): Remove unused test dependencies
matrei a0ca114
feat!(deps): Update to and compatible with Micronaut 4.5
matrei fb05a15
chore(deps): Remove unused test dependencies
matrei 3b868c7
docs: Add javadoc explaining that classes are ported from Spring
matrei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
grails-core/src/main/groovy/org/grails/asm/AbstractRecursiveAnnotationVisitor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* | ||
* Copyright 2002-2024 the original author or authors. | ||
* | ||
* Licensed 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 | ||
* | ||
* https://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 org.grails.asm; | ||
|
||
import java.lang.reflect.Field; | ||
import java.security.AccessControlException; | ||
|
||
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; | ||
|
||
import org.springframework.asm.AnnotationVisitor; | ||
import org.springframework.asm.SpringAsmInfo; | ||
import org.springframework.asm.Type; | ||
import org.springframework.core.annotation.AnnotationAttributes; | ||
import org.springframework.lang.Nullable; | ||
import org.springframework.util.ClassUtils; | ||
import org.springframework.util.ReflectionUtils; | ||
|
||
/** | ||
* {@link AnnotationVisitor} to recursively visit annotations. | ||
|
||
* <p>Note: This class was ported to Grails 7 from Spring Framework 5.3 as it was | ||
* removed in Spring 6 without a public replacement. | ||
* | ||
* @author Chris Beams | ||
* @author Juergen Hoeller | ||
* @author Phillip Webb | ||
* @author Sam Brannen | ||
* @since 3.1.1 | ||
* @deprecated As of Spring Framework 5.2, this class and related classes in this | ||
* package have been replaced by SimpleAnnotationMetadataReadingVisitor | ||
* and related classes for internal use within the framework. | ||
*/ | ||
@Deprecated | ||
abstract class AbstractRecursiveAnnotationVisitor extends AnnotationVisitor { | ||
|
||
protected final Log logger = LogFactory.getLog(getClass()); | ||
|
||
protected final AnnotationAttributes attributes; | ||
|
||
@Nullable | ||
protected final ClassLoader classLoader; | ||
|
||
|
||
public AbstractRecursiveAnnotationVisitor(@Nullable ClassLoader classLoader, AnnotationAttributes attributes) { | ||
super(SpringAsmInfo.ASM_VERSION); | ||
this.classLoader = classLoader; | ||
this.attributes = attributes; | ||
} | ||
|
||
|
||
@Override | ||
public void visit(String attributeName, Object attributeValue) { | ||
this.attributes.put(attributeName, attributeValue); | ||
} | ||
|
||
@Override | ||
public AnnotationVisitor visitAnnotation(String attributeName, String asmTypeDescriptor) { | ||
String annotationType = Type.getType(asmTypeDescriptor).getClassName(); | ||
AnnotationAttributes nestedAttributes = new AnnotationAttributes(annotationType, this.classLoader); | ||
this.attributes.put(attributeName, nestedAttributes); | ||
return new RecursiveAnnotationAttributesVisitor(annotationType, nestedAttributes, this.classLoader); | ||
} | ||
|
||
@Override | ||
public AnnotationVisitor visitArray(String attributeName) { | ||
return new RecursiveAnnotationArrayVisitor(attributeName, this.attributes, this.classLoader); | ||
} | ||
|
||
@Override | ||
public void visitEnum(String attributeName, String asmTypeDescriptor, String attributeValue) { | ||
Object newValue = getEnumValue(asmTypeDescriptor, attributeValue); | ||
visit(attributeName, newValue); | ||
} | ||
|
||
protected Object getEnumValue(String asmTypeDescriptor, String attributeValue) { | ||
Object valueToUse = attributeValue; | ||
try { | ||
Class<?> enumType = ClassUtils.forName(Type.getType(asmTypeDescriptor).getClassName(), this.classLoader); | ||
Field enumConstant = ReflectionUtils.findField(enumType, attributeValue); | ||
if (enumConstant != null) { | ||
ReflectionUtils.makeAccessible(enumConstant); | ||
valueToUse = enumConstant.get(null); | ||
} | ||
} | ||
catch (ClassNotFoundException | NoClassDefFoundError ex) { | ||
logger.debug("Failed to classload enum type while reading annotation metadata", ex); | ||
} | ||
catch (IllegalAccessException | AccessControlException ex) { | ||
logger.debug("Could not access enum value while reading annotation metadata", ex); | ||
} | ||
return valueToUse; | ||
} | ||
|
||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.