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] BooleanGetMethodName should have the option to treat boolean wrapper type differently · Issue #6958 · pmd/pmd Closed Labels a:false-positivePMD flags a piece of code that is not problematic Milestone DescriptionThe change introduced in #5253 was made under the assumption that returning a (primitive) Although they are similar, there are still a number of tools, including those following the Java Beans convention, that expect Here is an example: import org.apache.commons.beanutils.PropertyUtils; public class Test { public static class Item { public boolean isRed() { return true; } public Boolean getGreen() { return true; } public Boolean isBlue() { return true; } } public static void main(String[] args) throws Exception { Item item = new Item(); System.out.println("Accessing isRed() -> boolean: "); System.out.println(PropertyUtils.getProperty(item, "red")); System.out.println("Accessing getGreen() -> Boolean: "); System.out.println(PropertyUtils.getProperty(item, "green")); System.out.println("Accessing isBlue() -> Boolean: "); System.out.println(PropertyUtils.getProperty(item, "blue")); } } Here are the results: This will throw an exception when trying to get the " When using I would suggest either to reverse #5253, or to add an option to distinguish the wrapped type case (for Activity
MetadataMetadataAssigneesLabelsa:false-positivePMD flags a piece of code that is not problematic 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. |