Align implementations of StringToUUIDConverter and UUIDEditor

Closes gh-23940
This commit is contained in:
Sam Brannen
2019-11-06 14:21:52 +01:00
parent 92228f0fc0
commit 29b31cad48
2 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@ public class UUIDEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (StringUtils.hasText(text)) {
setValue(UUID.fromString(text));
setValue(UUID.fromString(text.trim()));
}
else {
setValue(null);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ final class StringToUUIDConverter implements Converter<String, UUID> {
@Override
public UUID convert(String source) {
return (StringUtils.hasLength(source) ? UUID.fromString(source.trim()) : null);
return (StringUtils.hasText(source) ? UUID.fromString(source.trim()) : null);
}
}