#22461 #1

Merged
fabio.sinibaldi merged 27 commits from #22461 into master 2022-01-14 12:43:19 +01:00
2 changed files with 6 additions and 0 deletions
Showing only changes of commit 41af4e3bc9 - Show all commits

View File

@ -7,9 +7,11 @@ import java.util.List;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@Getter
@Setter
@Slf4j
public class ConstraintCheck<T> {
public static <T> ConstraintCheck<T> defaultFor(T toCheck,T defaultValue){
@ -55,6 +57,8 @@ public class ConstraintCheck<T> {
T result=theObject;
if(isError()) {
result=theDefault;
log.debug("Applying default {} for current value {}",theDefault,theObject);
if(theDefault!=null && theDefault instanceof Collection) {
Collection defaultCollection=(Collection) theDefault;
ArrayList target=new ArrayList(defaultCollection);

View File

@ -85,6 +85,8 @@ public class Files {
}
public static String fixFilename(String toFix) {
if(toFix.startsWith("\\."))
toFix=toFix.replaceFirst("\\.","_");
String extension="";
if(toFix.contains(".")) {
//preserve extension