-
Notifications
You must be signed in to change notification settings - Fork 37.7k
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
Avoid memory leak when PropertyComparator is reused #26869
Conversation
Fixing memoryleak, PropertyComparator was remembering the value it compared in the past.
@FlorianKirmaier Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
Thanks for submitting your first PR for the Spring Framework, @FlorianKirmaier! We would like to merge this into Can you please sign the Contributor License Agreement (see #26869 (comment)). |
@FlorianKirmaier Thank you for signing the Contributor License Agreement! |
Just signed the CLA. |
return this.beanWrapper.getPropertyValue(this.sortDefinition.getProperty()); | ||
BeanWrapperImpl beanWrapper = new BeanWrapperImpl(false); | ||
beanWrapper.setWrappedInstance(obj); | ||
return beanWrapper.getPropertyValue(this.sortDefinition.getProperty()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that the formatting you introduced fails the build with the following.
> Task :spring-beans:checkstyleMain
[ant:checkstyle] [ERROR] /.../spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java:116: Line has leading space characters; indentation should be performed with tabs only. [RegexpSinglelineJava]
[ant:checkstyle] [ERROR] /.../spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java:117: Line has leading space characters; indentation should be performed with tabs only. [RegexpSinglelineJava]
[ant:checkstyle] [ERROR] /.../spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java:118: Line has leading space characters; indentation should be performed with tabs only. [RegexpSinglelineJava]
Please make sure you run ./gradlew check
before submitting a PR to catch such errors locally.
I'll fix the formatting before merging, so there's no need to update this PR.
This has been merged into Thanks |
This commit fixes a potential memory leak, since PropertyComparator previously kept an indirect reference to the value it last compared. Closes spring-projectsgh-26869
This commit fixes a potential memory leak, since PropertyComparator previously kept an indirect reference to the value it last compared. Closes spring-projectsgh-26869
Fixing memoryleak, PropertyComparator was remembering the value it compared in the past.