Tagged articles
BeanUtils
33 articles · Page 1 of 1
BeanUtils.copyProperties, a convenient Apache Commons utility for Java bean copying, harbors multiple hidden pitfalls—including reflection overhead, unsafe type conversion, null‑value overwrites, shallow copy issues, and limited depth—so developers should evaluate modern alternatives like MapStruct, Dozer, or manual mapping for better performance and safety.
BeanUtilsDeep CopyJava
0 likes · 7 min read

The article analyzes common Java property‑copy utilities, showing how tools like Spring BeanUtils, CGLIB BeanCopier and MapStruct can suffer from poor performance and runtime type‑conversion errors, and recommends using explicit converters generated by IDE plugins to avoid hidden bugs.
BeanUtilsJavaMapStruct
0 likes · 9 min read

This article explains why generic Java bean property copy utilities like Spring BeanUtils, Apache Commons BeanUtils, and CGLIB can cause runtime type conversion errors and performance issues, demonstrates the problems with code examples, and recommends using custom converters or IDE‑generated mapping code such as MapStruct for safe and efficient object transformation.
BackendBeanUtilsCGLIB
0 likes · 8 min read

This article explains the roles of DTO, VO, and PO in Java applications, compares manual property copying with BeanUtils and MapStruct, provides complete code examples for both approaches, and offers guidance on choosing the appropriate method based on performance and project needs.
BackendBeanUtilsDTO
0 likes · 13 min read

Spring’s BeanUtils.copyProperties is error‑prone and slow due to type mismatches, primitive‑wrapper issues, null overwrites and reflection, whereas MapStruct generates compile‑time, type‑safe mapper code that avoids these pitfalls, delivers far better performance, and integrates easily with Maven and Lombok.
BeanUtilsJavaMapStruct
0 likes · 6 min read

The article explains the limitations of Spring's BeanUtils.copyProperties—such as type mismatches, null overwriting, and reflection overhead—and demonstrates how MapStruct provides a faster, compile‑time generated alternative for copying properties between Java objects, with usage examples and Maven setup.
BeanUtilsJavaMapStruct
0 likes · 6 min read

A Java backend debugging story explains how using BeanUtils.copyProperties led to a ClassCastException when a HashMap was cast to a custom class, details the investigation steps, shows the problematic code, and presents a manual assignment solution plus recommendations for safer mapping tools.
BeanUtilsClassCastExceptionCopyProperties
0 likes · 4 min read


JD TechMar 20, 2024 · Backend Development
The article details a real‑world debugging case where a Java service threw a ClassCastException due to BeanUtils.copyProperties performing a shallow copy, explains the investigation steps, shows the problematic code, and presents a manual‑assignment solution along with reflections on safer alternatives.
BeanUtilsClassCastExceptionJava
0 likes · 5 min read

This article explains seven subtle issues when using Spring's BeanUtils.copyProperties—such as type mismatches, null overwrites, wrong imports, inner‑class copying failures, shallow copy side effects, and performance drawbacks—providing code examples and recommendations to avoid them.
BackendBeanUtilsCopyProperties
0 likes · 10 min read

This article outlines common pitfalls of using Spring's BeanUtils.copyProperties for object property copying in Java backend development, including type mismatches, null overwrites, incorrect imports, inner class issues, shallow copy behavior, and performance drawbacks, and advises caution when employing this utility.
BackendBeanUtilsCopyProperties
0 likes · 8 min read

The article explains why using automatic property copy utilities in Java can lead to performance degradation, hidden type‑conversion bugs, and runtime errors, and demonstrates safer approaches such as manually written converters, IDE‑generated code, and MapStruct with concrete examples and code snippets.
BeanUtilsMapStructType Conversion
0 likes · 8 min read

This article examines common pitfalls when converting Java Beans to Map objects—such as type loss with JSON libraries and incorrect property name resolution in BeanMap utilities—and presents a robust solution using Dubbo's PojoUtils along with detailed code examples and analysis.
Bean to MapBeanUtilsDubbo
0 likes · 12 min read

The article explains the performance drawbacks, hidden type‑conversion bugs, and runtime errors caused by generic Java property‑copy utilities such as BeanUtils and CGLIB, and demonstrates how compile‑time‑checked tools like MapStruct can safely handle conversions.
BackendBeanUtilsMapStruct
0 likes · 8 min read

This article analyzes the performance and implementation differences of various Java object‑copy utilities—including Apache BeanUtils, PropertyUtils, Spring BeanCopier, and Spring BeanUtils—by examining source code, benchmarking copy operations, and recommending alternatives to avoid the inefficiencies of Apache BeanUtils.
ApacheBeanUtilsJava
0 likes · 11 min read

This article explains why using automatic property copy utilities like Spring BeanUtils, CGLIB BeanCopier, or MapStruct can lead to hidden type conversion errors in Java, compares their performance, demonstrates pitfalls with generic type erasure, and recommends writing explicit conversion classes to avoid runtime bugs.
BeanUtilsCGLIBJava
0 likes · 9 min read

MapStruct dramatically outperforms Spring's BeanUtils for Java object mapping by generating compile-time code that avoids reflection, achieving roughly ten-to-thirty times faster conversions—even across dozens of fields—while requiring only simple PO/Entity definitions and optional @Mapping annotations, making it a superior, low-learning-curve replacement.
BeanUtilsJavaMapStruct
0 likes · 14 min read

This article introduces a custom BeanConvertUtils class that extends BeanUtils to provide concise, lambda‑friendly conversion of single objects and lists between PO, VO, and DTO types, while highlighting BeanUtils limitations, performance impact, and important usage cautions.
BeanUtilsObject MappingUtility
0 likes · 7 min read

This article explains the different POJO variants—VO, BO, PO, DTO, and DO—describes their typical usage in layered Java applications, introduces the Simple Object Copy IntelliJ plugin for one‑click conversion method generation, compares it with common mapping tools such as MapStruct and BeanUtils, and discusses performance and flexibility advantages.
BeanUtilsIDE pluginJava
0 likes · 10 min read

This article examines the performance drawbacks and hidden type‑conversion issues of common Java property‑copy utilities such as Spring BeanUtils, CGLIB BeanCopier, and MapStruct, demonstrates concrete code examples, and recommends using explicit conversion classes or IDE‑generated getters/setters to avoid runtime errors.
BeanUtilsJavaMapStruct
0 likes · 9 min read

This article explains how Spring's BeanUtils.copyProperties performs a shallow copy, outlines scenarios where it is appropriate, compares it with manual setters, and provides Java code examples illustrating its behavior with parent‑child classes and common pitfalls.
BeanUtilsCodeExampleJava
0 likes · 5 min read

This article demonstrates how to use Spring's BeanUtils.copyProperties method to copy properties between objects and provides a generic utility to convert a list of source objects into a list of target objects, illustrated with Java code examples for User and Employee classes.
BackendBeanUtilsJava
0 likes · 5 min read

This article explains the difference between shallow and deep copying in Java, demonstrates how Apache Commons BeanUtils and Spring Framework BeanUtils perform property copying with code examples, highlights performance concerns, and recommends more efficient alternatives for backend development.
ApacheBackendBeanUtils
0 likes · 8 min read

This article examines the drawbacks of using Java property copy utilities such as Spring BeanUtils, CGLIB BeanCopier, and Apache Commons BeanUtils, demonstrates type‑conversion errors through code examples, compares their performance, and recommends defining explicit conversion classes or using MapStruct for safer, compile‑time‑checked mappings.
BeanUtilsCGLIBJava
0 likes · 7 min read

This article explains the difference between shallow and deep copying in Java, compares Apache BeanUtils and Spring BeanUtils with code examples, highlights performance and safety concerns, and recommends using Spring BeanUtils or alternative libraries for efficient property transfer between objects.
ApacheBeanUtilsDeepCopy
0 likes · 10 min read

This article examines the pitfalls of Java property‑copy utilities such as Spring BeanUtils, CGLIB BeanCopier, and MapStruct, demonstrating performance drawbacks and runtime type‑conversion errors through concrete examples, and recommends defining explicit conversion classes or using IDE‑generated code to avoid hidden bugs.
BeanUtilsJavaMapStruct
0 likes · 9 min read

This article explains why using generic property copy utilities like Apache Commons BeanUtils, Spring BeanUtils, CGLIB BeanCopier, or MapStruct can lead to performance degradation, type‑conversion errors, and hidden bugs in Java applications, and recommends defining explicit conversion classes with IDE‑generated getters and setters for safer, compile‑time‑checked mappings.
BeanUtilsCGLIBJava
0 likes · 9 min read

This article examines the hidden risks and performance drawbacks of Java bean property copy utilities such as Spring BeanUtils, CGLIB BeanCopier, and MapStruct, demonstrates concrete examples of type‑conversion errors, and recommends custom converters or IDE‑generated mapping code for reliable data transfer.
BeanUtilsCGLIBJava
0 likes · 9 min read

This article explains the concepts of shallow and deep copying in Java, demonstrates how to use Apache BeanUtils and Spring BeanUtils for property copying between objects, compares their implementations and performance, and recommends alternative tools for efficient object mapping.
ApacheBeanUtilsDeepCopy
0 likes · 9 min read

This article explains the differences between Apache BeanUtils and Spring BeanUtils for copying Java objects, covering shallow vs deep copy concepts, performance drawbacks of Apache's implementation, usage examples, and recommendations for alternative tools like CGLIB BeanCopier and Orika.
ApacheBeanUtilsDeepCopy
0 likes · 9 min read

This article explains how to copy properties between Java objects, clarifies shallow and deep copy concepts, compares Apache BeanUtils and Spring BeanUtils with code examples, and advises on performance and best‑practice choices for backend development.
BeanUtilsDeepCopyJava
0 likes · 9 min read

This article explains why Spring's BeanUtils.copyProperties cannot copy static inner class fields and list properties, demonstrates the pitfalls with missing getters/setters, and provides a step‑by‑step solution to correctly copy such objects in Java applications.
BeanUtilsCopyPropertiesJava
0 likes · 9 min read

This article explains why Spring's BeanUtils.copyProperties cannot copy static inner class fields and List properties without proper getters/setters, demonstrates the issue with demo code, and provides practical solutions to ensure successful property copying.
BeanUtilsCopyPropertiesJava
0 likes · 7 min read

In a recent Java backend project, using Spring's BeanUtils.copyProperties to copy a request object with static inner classes and List fields caused missing fields and request failures, revealing the need for proper getters, setters, and separate handling of inner‑class properties.
BeanUtilsCopyPropertiesJava
0 likes · 6 min read
