Skip to content

Commit

Permalink
fix: some bugs discovered via oslc4net
Browse files Browse the repository at this point in the history
  • Loading branch information
berezovskyi committed Nov 7, 2023
1 parent 0b3a243 commit 1c6ca74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.ServletContextEvent;

import java.util.List;
import java.util.ArrayList;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -65,6 +67,7 @@
import java.net.URI;
import java.util.Date;
import java.util.UUID;
import java.util.NoSuchElementException;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
Expand Down Expand Up @@ -335,7 +338,12 @@ public ChangeRequest getChangeRequest(HttpServletRequest httpServletRequest, fin


// Start of user code getChangeRequest
aResource = changeRequestRepository.getResource(SP_DEFAULT, id);
try {
aResource = changeRequestRepository.getResource(SP_DEFAULT, id);
} catch (NoSuchElementException e) {
return null;
// throw new WebApplicationException(Response.Status.NOT_FOUND);
}
// End of user code
return aResource;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private static SortedSet<URI> getServiceProviderDomains(final ServiceProvider se
* creation to create unique URI paths for each ServiceProvider.
*
*/
protected static void initServiceProviders (HttpServletRequest httpServletRequest)
protected static synchronized void initServiceProviders (HttpServletRequest httpServletRequest)
{
try {
// Start of user code initServiceProviders
Expand Down

0 comments on commit 1c6ca74

Please sign in to comment.