daledotshan/liferay-portal — pull request #146 by zxdgoal (2014-12-08 11:40:32+00:00)
Title: LPS-52059 Inconsistent 404 error for invalid links.

Hey Dale.

InvalidRepositoryIdException should be thrown instead of RepositoryException because :

RepositoryException is not catch in DLAppLocalServiceImpl.java#getLocalRepository
```
protected LocalRepository getLocalRepository(long repositoryId)
throws PortalException, SystemException {

try {
return repositoryLocalService.getLocalRepositoryImpl(repositoryId);
}
catch (InvalidRepositoryIdException irie) {
StringBundler sb = new StringBundler(3);

sb.append("No Group exists with the key {repositoryId=");
sb.append(repositoryId);
sb.append("}");

throw new NoSuchGroupException(sb.toString(), irie);
}
}
```

This leads to is VirtualHostFilter#DocumentFriendlyURL return TRUE as WebServerServlet.hasFiles(request) returns TRUE.

But the value should be false as we don't even have the repository.

Let me know if you have any concerns.

Thanks
John.