Start entity types with a capital char

This commit is contained in:
René Pfeuffer
2019-03-12 15:10:43 +01:00
parent 77fb869ce4
commit 6ebbfa97a3
12 changed files with 14 additions and 14 deletions

View File

@@ -77,7 +77,7 @@ public final class HookEventFacade
Repository repository = repositoryManagerProvider.get().get(id); Repository repository = repositoryManagerProvider.get().get(id);
if (repository == null) if (repository == null)
{ {
throw notFound(entity("repository", id)); throw notFound(entity("Repository", id));
} }
return handle(repository); return handle(repository);
} }

View File

@@ -205,7 +205,7 @@ public final class GitUtil
} }
catch (GitAPIException ex) catch (GitAPIException ex)
{ {
throw new InternalRepositoryException(ContextEntry.ContextBuilder.entity("remote", directory.toString()).in(remoteRepository), "could not fetch", ex); throw new InternalRepositoryException(ContextEntry.ContextBuilder.entity("Remote", directory.toString()).in(remoteRepository), "could not fetch", ex);
} }
} }

View File

@@ -110,7 +110,7 @@ public class GitBlameCommand extends AbstractGitCommand implements BlameCommand
if (gitBlameResult == null) if (gitBlameResult == null)
{ {
throw new InternalRepositoryException(entity("path", request.getPath()).in(repository), throw new InternalRepositoryException(entity("Path", request.getPath()).in(repository),
"could not create blame result for path"); "could not create blame result for path");
} }

View File

@@ -358,7 +358,7 @@ public class GitBrowseCommand extends AbstractGitCommand
} }
} }
throw new NotFoundException("file", request.getPath()); throw notFound(entity("File", request.getPath()).in("Revision", revId.getName()).in(this.repository));
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")

View File

@@ -74,7 +74,7 @@ public class GitMergeCommand extends AbstractGitCommand implements MergeCommand
private ObjectId resolveRevisionOrThrowNotFound(Repository repository, String revision) throws IOException { private ObjectId resolveRevisionOrThrowNotFound(Repository repository, String revision) throws IOException {
ObjectId resolved = repository.resolve(revision); ObjectId resolved = repository.resolve(revision);
if (resolved == null) { if (resolved == null) {
throw notFound(entity("revision", revision).in(context.getRepository())); throw notFound(entity("Revision", revision).in(context.getRepository()));
} else { } else {
return resolved; return resolved;
} }
@@ -125,7 +125,7 @@ public class GitMergeCommand extends AbstractGitCommand implements MergeCommand
clone.checkout().setStartPoint(targetRevision.getName()).setName(target).setCreateBranch(true).call(); clone.checkout().setStartPoint(targetRevision.getName()).setName(target).setCreateBranch(true).call();
} catch (RefNotFoundException e) { } catch (RefNotFoundException e) {
logger.debug("could not checkout target branch {} for merge as local branch", target, e); logger.debug("could not checkout target branch {} for merge as local branch", target, e);
throw notFound(entity("revision", target).in(context.getRepository())); throw notFound(entity("Revision", target).in(context.getRepository()));
} catch (GitAPIException e) { } catch (GitAPIException e) {
throw new InternalRepositoryException(context.getRepository(), "could not checkout target branch for merge as local branch: " + target, e); throw new InternalRepositoryException(context.getRepository(), "could not checkout target branch for merge as local branch: " + target, e);
} }

View File

@@ -349,7 +349,7 @@ public class HgRepositoryHandler
try { try {
return new INIConfigurationReader().read(new File(directory, PATH_HGRC)).getSection(CONFIG_SECTION_SCMM).getParameter(CONFIG_KEY_REPOSITORY_ID); return new INIConfigurationReader().read(new File(directory, PATH_HGRC)).getSection(CONFIG_SECTION_SCMM).getParameter(CONFIG_KEY_REPOSITORY_ID);
} catch (IOException e) { } catch (IOException e) {
throw new InternalRepositoryException(ContextEntry.ContextBuilder.entity("directory", directory.toString()), "could not read scm configuration file", e); throw new InternalRepositoryException(ContextEntry.ContextBuilder.entity("Directory", directory.toString()), "could not read scm configuration file", e);
} }
} }

View File

@@ -234,7 +234,7 @@ public class SvnRepositoryHandler
try { try {
return new INIConfigurationReader().read(new File(directory, CONFIG_FILE_NAME)).getSection(CONFIG_SECTION_SCMM).getParameter(CONFIG_KEY_REPOSITORY_ID); return new INIConfigurationReader().read(new File(directory, CONFIG_FILE_NAME)).getSection(CONFIG_SECTION_SCMM).getParameter(CONFIG_KEY_REPOSITORY_ID);
} catch (IOException e) { } catch (IOException e) {
throw new InternalRepositoryException(ContextEntry.ContextBuilder.entity("directory", directory.toString()), "could not read scm configuration file", e); throw new InternalRepositoryException(ContextEntry.ContextBuilder.entity("Directory", directory.toString()), "could not read scm configuration file", e);
} }
} }
} }

View File

@@ -85,7 +85,7 @@ public class FileHistoryRootResource {
} else { } else {
String message = String.format("for the revision %s and the file %s there are no changesets", revision, path); String message = String.format("for the revision %s and the file %s there are no changesets", revision, path);
log.error(message); log.error(message);
throw notFound(entity("path", path).in("revision", revision).in(namespaceAndName)); throw notFound(entity("Path", path).in("revision", revision).in(namespaceAndName));
} }
} }
} }

View File

@@ -258,7 +258,7 @@ public class RepositoryPermissionRootResource {
*/ */
private void checkPermissionAlreadyExists(RepositoryPermissionDto permission, Repository repository) { private void checkPermissionAlreadyExists(RepositoryPermissionDto permission, Repository repository) {
if (isPermissionExist(permission, repository)) { if (isPermissionExist(permission, repository)) {
throw alreadyExists(entity("permission", permission.getName()).in(repository)); throw alreadyExists(entity("Permission", permission.getName()).in(repository));
} }
} }

View File

@@ -65,7 +65,7 @@ public class SourceRootResource {
if (browserResult != null) { if (browserResult != null) {
return Response.ok(browserResultToFileObjectDtoMapper.map(browserResult, namespaceAndName)).build(); return Response.ok(browserResultToFileObjectDtoMapper.map(browserResult, namespaceAndName)).build();
} else { } else {
throw notFound(entity("sources", path).in(namespaceAndName)); throw notFound(entity("Source", path).in(namespaceAndName));
} }
} }
} }

View File

@@ -77,7 +77,7 @@ public class PermissionAssigner {
private Predicate<PermissionDescriptor> permissionExists(Collection<PermissionDescriptor> availablePermissions, Collection<AssignedPermission> existingPermissions) { private Predicate<PermissionDescriptor> permissionExists(Collection<PermissionDescriptor> availablePermissions, Collection<AssignedPermission> existingPermissions) {
return p -> { return p -> {
if (!availablePermissions.contains(p) && existingPermissions.stream().map(AssignedPermission::getPermission).noneMatch(e -> e.equals(p))) { if (!availablePermissions.contains(p) && existingPermissions.stream().map(AssignedPermission::getPermission).noneMatch(e -> e.equals(p))) {
throw NotFoundException.notFound(ContextEntry.ContextBuilder.entity("permission", p.getValue())); throw NotFoundException.notFound(ContextEntry.ContextBuilder.entity("Permission", p.getValue()));
} }
return true; return true;
}; };

View File

@@ -403,7 +403,7 @@ public class DefaultUserManager extends AbstractUserManager
User user = get((String) SecurityUtils.getSubject().getPrincipals().getPrimaryPrincipal()); User user = get((String) SecurityUtils.getSubject().getPrincipals().getPrimaryPrincipal());
if (!user.getPassword().equals(oldPassword)) { if (!user.getPassword().equals(oldPassword)) {
throw new InvalidPasswordException(ContextEntry.ContextBuilder.entity("passwordChange", "-").in(User.class, user.getName())); throw new InvalidPasswordException(ContextEntry.ContextBuilder.entity("PasswordChange", "-").in(User.class, user.getName()));
} }
user.setPassword(newPassword); user.setPassword(newPassword);
@@ -422,7 +422,7 @@ public class DefaultUserManager extends AbstractUserManager
throw new NotFoundException(User.class, userId); throw new NotFoundException(User.class, userId);
} }
if (!isTypeDefault(user)) { if (!isTypeDefault(user)) {
throw new ChangePasswordNotAllowedException(ContextEntry.ContextBuilder.entity("passwordChange", "-").in(User.class, user.getName()), user.getType()); throw new ChangePasswordNotAllowedException(ContextEntry.ContextBuilder.entity("PasswordChange", "-").in(User.class, user.getName()), user.getType());
} }
user.setPassword(newPassword); user.setPassword(newPassword);
this.modify(user); this.modify(user);