Skip to content

Commit 17086ba

Browse files
spotless:fix
1 parent fe58f79 commit 17086ba

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

sdm/src/main/java/com/sap/cds/sdm/handler/applicationservice/SDMCreateAttachmentsHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ private void processAttachment(
237237
AttachmentsHandlerUtils.updateFilenameProperty(
238238
fileNameInDB, filenameInRequest, fileNameInSDM, updatedSecondaryProperties);
239239
AttachmentsHandlerUtils.updateDescriptionProperty(
240-
descriptionInSDM, descriptionInRequest, descriptionInSDM, updatedSecondaryProperties, false);
240+
descriptionInSDM,
241+
descriptionInRequest,
242+
descriptionInSDM,
243+
updatedSecondaryProperties,
244+
false);
241245

242246
// Send update to SDM and handle response
243247
try {

sdm/src/main/java/com/sap/cds/sdm/handler/applicationservice/helper/AttachmentsHandlerUtils.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,10 @@ public static List<String> fetchAttachmentDataFromSDM(
626626
* @throws ServiceException if filename validation fails
627627
*/
628628
public static void updateFilenameProperty(
629-
String fileNameInDB, String filenameInRequest, String fileNameInSDM, Map<String, String> updatedSecondaryProperties)
629+
String fileNameInDB,
630+
String filenameInRequest,
631+
String fileNameInSDM,
632+
Map<String, String> updatedSecondaryProperties)
630633
throws ServiceException {
631634
if (fileNameInDB == null) {
632635
if (filenameInRequest != null && (filenameInRequest != fileNameInSDM)) {
@@ -644,18 +647,27 @@ public static void updateFilenameProperty(
644647
}
645648

646649
public static void updateDescriptionProperty(
647-
String descriptionInDB, String descriptionInRequest, String descriptionInSDM, Map<String, String> updatedSecondaryProperties, Boolean isUpdate)
650+
String descriptionInDB,
651+
String descriptionInRequest,
652+
String descriptionInSDM,
653+
Map<String, String> updatedSecondaryProperties,
654+
Boolean isUpdate)
648655
throws ServiceException {
649-
if (descriptionInDB == null && isUpdate) { // Attachment did not contain description and is being updated now
656+
if (descriptionInDB == null
657+
&& isUpdate) { // Attachment did not contain description and is being updated now
650658
if (descriptionInRequest != null) {
651659
updatedSecondaryProperties.put("description", descriptionInRequest);
652660
}
653-
} else if (descriptionInDB == null && !isUpdate) { // Attachment contained description during upload and it was changed before saving or description was added before save handler (create) was called
661+
} else if (descriptionInDB == null
662+
&& !isUpdate) { // Attachment contained description during upload and it was changed before
663+
// saving or description was added before save handler (create) was called
654664
if ((descriptionInRequest != descriptionInSDM)) {
655665
updatedSecondaryProperties.put("description", descriptionInRequest);
656666
}
657-
} else if ((descriptionInDB != null) && (descriptionInDB != descriptionInRequest)) { // Attachment contained description and is being updated now
658-
updatedSecondaryProperties.put("description", descriptionInRequest);
667+
} else if ((descriptionInDB != null)
668+
&& (descriptionInDB
669+
!= descriptionInRequest)) { // Attachment contained description and is being updated now
670+
updatedSecondaryProperties.put("description", descriptionInRequest);
659671
}
660672
}
661673

0 commit comments

Comments
 (0)