Skip to content

Commit

Permalink
fix: add message when use Assert.notNull (#1702)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenting authored Nov 29, 2023
1 parent 1a29e4f commit 048e94b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public boolean matches(StoreInfo info) {
};

static StoreFilter withDomainClass(Class<?> domainClass) {
Assert.notNull(domainClass);
Assert.notNull(domainClass, "domainClass must not be null");

return new StoreFilter() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class FileSystemResourceLoader
private FileService fileService = null;

public FileSystemResourceLoader(String root) {
Assert.notNull(root);
Assert.notNull(root, "root must not be null");
logger.info(String.format("Defaulting filesystem root to %s", root));
this.root = new FileSystemResource(suffixPath(cleanPath(root)));
this.fileService = new FileServiceImpl();
Expand All @@ -59,7 +59,7 @@ private String suffixPath(String path) {

@Override
public Resource getResource(String location) {
Assert.notNull(root);
Assert.notNull(root, "root must not be null");
Resource resource = root.createRelative(location);
if (resource instanceof FileSystemResource) {
resource = new FileSystemDeletableResource((FileSystemResource) resource, fileService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class POIServiceImpl implements org.springframework.renditions.poi.POISer

@Override
public XWPFDocument xwpfDocument(InputStream stream) throws IOException {
Assert.notNull(stream);
Assert.notNull(stream, "stream must not be null");
return new XWPFDocument(stream);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void setContent(HttpServletRequest request, HttpServletResponse response,
@Override
public void unsetContent(Resource resource) {

Assert.notNull(resource);
Assert.notNull(resource, "resource must not be null");
if (resource instanceof DeletableResource) {
try {
((DeletableResource) resource).delete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private Link shortcutLink(URI baseUri, StoreInfo store, Object id, String defaul

private Link fullyQualifiedLink(URI baseUri, StoreInfo store, Object id, Map.Entry<String, ContentProperty> contentPropertyEntry) {

Assert.notNull(id);
Assert.notNull(id, "id must not be null");

LinkBuilder builder = StoreLinkBuilder.linkTo(new BaseUri(baseUri), store);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public String getRequestURI() {
* @return a ContentPropertyRequest
*/
public static ContentPropertyRequest from(String storeLookupPath) {
Assert.notNull(storeLookupPath);
Assert.notNull(storeLookupPath, "storeLookupPath must not be null");

String[] path = storeLookupPath.split("/");
if (path.length < 3) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ public class OptimisticLockingInterceptor implements MethodInterceptor {

static {
getContentMethod = ReflectionUtils.findMethod(ContentStore.class, "getContent", Object.class);
Assert.notNull(getContentMethod);
Assert.notNull(getContentMethod, "Unable to find getContent method");
getContentPropertyPathMethod = ReflectionUtils.findMethod(ContentStore.class, "getContent", Object.class, PropertyPath.class);
Assert.notNull(getContentPropertyPathMethod);
Assert.notNull(getContentPropertyPathMethod, "Unable to find getContent method");
setContentMethod = ReflectionUtils.findMethod(ContentStore.class, "setContent", Object.class, InputStream.class);
Assert.notNull(setContentMethod);
Assert.notNull(setContentMethod, "Unable to find setContent method");
setContentPropertyPathMethod = ReflectionUtils.findMethod(ContentStore.class, "setContent", Object.class, PropertyPath.class, InputStream.class);
Assert.notNull(setContentPropertyPathMethod);
Assert.notNull(setContentPropertyPathMethod, "Unable to find setContent method");
setContentMethodWithResource = ReflectionUtils.findMethod(ContentStore.class, "setContent", Object.class, Resource.class);
Assert.notNull(setContentMethodWithResource);
Assert.notNull(setContentMethodWithResource, "Unable to find setContent method");
setContentMethodWithPropertyPathAndResource = ReflectionUtils.findMethod(ContentStore.class, "setContent", Object.class, PropertyPath.class, Resource.class);
Assert.notNull(setContentMethodWithPropertyPathAndResource);
Assert.notNull(setContentMethodWithPropertyPathAndResource, "Unable to find setContent method");
unsetContentMethod = ReflectionUtils.findMethod(ContentStore.class,"unsetContent", Object.class);
Assert.notNull(unsetContentMethod);
Assert.notNull(unsetContentMethod, "Unable to find unsetContent method");
unsetContentPropertyPathMethod = ReflectionUtils.findMethod(ContentStore.class,"unsetContent", Object.class, PropertyPath.class);
Assert.notNull(unsetContentPropertyPathMethod);
Assert.notNull(unsetContentPropertyPathMethod, "Unable to find unsetContent method");
}

private final EntityManager em;
Expand Down

0 comments on commit 048e94b

Please sign in to comment.