Skip to content

Commit 388cbd1

Browse files
authored
- Skip deprecated functions when merging objects (#173)
1 parent ca60b96 commit 388cbd1

File tree

3 files changed

+48
-311
lines changed

3 files changed

+48
-311
lines changed

src/main/java/com/easypost/net/EasyPostResource.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,11 @@ public void merge(final EasyPostResource obj, final EasyPostResource update) {
785785
for (Method fromMethod : methods) {
786786
if (fromMethod.getName().startsWith("get") || GLOBAL_FIELD_ACCESSORS.contains(fromMethod.getName())) {
787787

788+
if (fromMethod.isAnnotationPresent(Deprecated.class)) {
789+
// skip deprecated methods
790+
continue;
791+
}
792+
788793
String fromName = fromMethod.getName();
789794
String toName = fromName.replace("get", "set");
790795

0 commit comments

Comments
 (0)