diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2018-02-22 23:10:14 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-02-22 23:16:42 +0100 |
commit | 520f3af7b4e321459d644373cf7bac2ef104e434 (patch) | |
tree | 1d4bce38d0bc1564f41cd6b0c8884b27dd455530 /org.eclipse.jgit.junit.http | |
parent | 879372eb72d8b8a073f4f73d98caa1cd15971bd5 (diff) | |
download | jgit-520f3af7b4e321459d644373cf7bac2ef104e434.tar.gz jgit-520f3af7b4e321459d644373cf7bac2ef104e434.zip |
Fix indentation in TestRequestLog
We use tabs to indent.
Change-Id: I19b00e06becfb92fbabb99b5699385506fd85214
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.junit.http')
-rw-r--r-- | org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java | 151 |
1 files changed, 76 insertions, 75 deletions
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java index 43181f2e13..112c197b2d 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java @@ -59,79 +59,80 @@ import org.eclipse.jetty.server.handler.HandlerWrapper; /** Logs request made through {@link AppServer}. */ class TestRequestLog extends HandlerWrapper { - private static final int MAX = 16; - - private final List<AccessEvent> events = new ArrayList<>(); - - private final Semaphore active = new Semaphore(MAX); - - /** Reset the log back to its original empty state. */ - void clear() { - try { - for (;;) { - try { - active.acquire(MAX); - break; - } catch (InterruptedException e) { - continue; - } - } - - synchronized (events) { - events.clear(); - } - } finally { - active.release(MAX); - } - } - - /** @return all of the events made since the last clear. */ - List<AccessEvent> getEvents() { - try { - for (;;) { - try { - active.acquire(MAX); - break; - } catch (InterruptedException e) { - continue; - } - } - - synchronized (events) { - return events; - } - } finally { - active.release(MAX); - } - } - - /** {@inheritDoc} */ - @Override - public void handle(String target, Request baseRequest, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - try { - for (;;) { - try { - active.acquire(); - break; - } catch (InterruptedException e) { - continue; - } - } - - super.handle(target, baseRequest, request, response); - - if (DispatcherType.REQUEST.equals(baseRequest.getDispatcherType())) - log((Request) request, (Response) response); - - } finally { - active.release(); - } - } - - private void log(Request request, Response response) { - synchronized (events) { - events.add(new AccessEvent(request, response)); - } - } + private static final int MAX = 16; + + private final List<AccessEvent> events = new ArrayList<>(); + + private final Semaphore active = new Semaphore(MAX); + + /** Reset the log back to its original empty state. */ + void clear() { + try { + for (;;) { + try { + active.acquire(MAX); + break; + } catch (InterruptedException e) { + continue; + } + } + + synchronized (events) { + events.clear(); + } + } finally { + active.release(MAX); + } + } + + /** @return all of the events made since the last clear. */ + List<AccessEvent> getEvents() { + try { + for (;;) { + try { + active.acquire(MAX); + break; + } catch (InterruptedException e) { + continue; + } + } + + synchronized (events) { + return events; + } + } finally { + active.release(MAX); + } + } + + /** {@inheritDoc} */ + @Override + public void handle(String target, Request baseRequest, + HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + try { + for (;;) { + try { + active.acquire(); + break; + } catch (InterruptedException e) { + continue; + } + } + + super.handle(target, baseRequest, request, response); + + if (DispatcherType.REQUEST.equals(baseRequest.getDispatcherType())) + log((Request) request, (Response) response); + + } finally { + active.release(); + } + } + + private void log(Request request, Response response) { + synchronized (events) { + events.add(new AccessEvent(request, response)); + } + } } |