GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [java] CloseResource: support Lombok's @Cleanup annotation · Issue #2757 · pmd/pmd Closed Labels a:false-positivePMD flags a piece of code that is not problematican:enhancementAn improvement on existing features / rules Milestone DescriptionAffects PMD Version: Description: Version 6.27.0 breaks support for Lombok's Cleanup Annotation which generates invocation of the Falling back to 6.26.0 works as expected by not producing the same violation. Exception Stacktrace: <violation ... rule="CloseResource" ruleset="Error Prone" ... class="ShabbatTimesStreamHandler" method="getCreator" variable="context" externalInfoUrl="https://pmd.github.io/pmd-6.27.0/pmd_rules_java_errorprone.html#closeresource" priority="3"> Ensure that resources like this AnnotationConfigApplicationContext object are closed after use </violation> Code Sample demonstrating the issue: Copied from a public repository: TomerFi/alexa-skill-shabbat-times public class ShabbatTimesStreamHandler extends SkillStreamHandler { private static ShabbatTimesSkillCreator getCreator() { @Cleanup val context = new AnnotationConfigApplicationContext(DiProdConfiguration.class); return context.getBean(ShabbatTimesSkillCreator.class); } public ShabbatTimesStreamHandler() { super(getCreator().getSkill()); } } Steps to reproduce: Please provide detailed steps for how we can reproduce the bug.
git clone https://github.com/TomerFi/alexa-skill-shabbat-times.git
cd alexa-skill-shabbat-times
mvn pmd:check
<properties> ... <pmd.version>6.27.0</pmd.version> ... </properties>
mvn pmd:check will now produce: Running PMD through: Maven Activity
MetadataMetadataAssigneesLabelsa:false-positivePMD flags a piece of code that is not problematican:enhancementAn improvement on existing features / rules TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |