GeezerVison is showing github.com — Merge pull request #869 from grgrzybek/jetty-9.2.x-868 · jetty/jetty.project@c07d842
File tree
Expand file treeCollapse file tree
Open diff view settings
jetty-continuation/src/main/java/org/eclipse/jetty/continuation jetty-util/src/main/java/org/eclipse/jetty/util
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationThrowable.java +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
43 | 43 | * </p> |
44 | 44 | */ |
45 | 45 | public class ContinuationThrowable extends Error |
46 | | -{} |
| 46 | +{ |
| 47 | + public ContinuationThrowable() |
| 48 | + { |
| 49 | + super(null, null, false, false); |
| 50 | + } |
| 51 | +} |
Collapse file
Copy file name to clipboardExpand all lines: jetty-util/src/main/java/org/eclipse/jetty/util/BlockingCallback.java +1-5Lines changed: 1 addition & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -36,11 +36,7 @@ public class BlockingCallback implements Callback |
36 | 36 | { |
37 | 37 | private static final Logger LOG = Log.getLogger(BlockingCallback.class); |
38 | 38 |
|
39 | | - private static Throwable SUCCEEDED=new Throwable() |
40 | | - { |
41 | | - @Override |
42 | | - public String toString() { return "SUCCEEDED"; } |
43 | | - }; |
| 39 | + private static Throwable SUCCEEDED = new ConstantThrowable("SUCCEEDED"); |
44 | 40 |
|
45 | 41 | private final CountDownLatch _latch = new CountDownLatch(1); |
46 | 42 | private final AtomicReference<Throwable> _state = new AtomicReference<>(); |
|
Collapse file
Copy file name to clipboard +43Lines changed: 43 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +// |
| 2 | +// ======================================================================== |
| 3 | +// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd. |
| 4 | +// ------------------------------------------------------------------------ |
| 5 | +// All rights reserved. This program and the accompanying materials |
| 6 | +// are made available under the terms of the Eclipse Public License v1.0 |
| 7 | +// and Apache License v2.0 which accompanies this distribution. |
| 8 | +// |
| 9 | +// The Eclipse Public License is available at |
| 10 | +// http://www.eclipse.org/legal/epl-v10.html |
| 11 | +// |
| 12 | +// The Apache License v2.0 is available at |
| 13 | +// http://www.opensource.org/licenses/apache2.0.php |
| 14 | +// |
| 15 | +// You may elect to redistribute this code under either of these licenses. |
| 16 | +// ======================================================================== |
| 17 | +// |
| 18 | + |
| 19 | +package org.eclipse.jetty.util; |
| 20 | + |
| 21 | +/** |
| 22 | + * A {@link Throwable} that may be used in static contexts. It uses Java 7 |
| 23 | + * constructor that prevents setting stackTrace inside exception object. |
| 24 | + */ |
| 25 | +public class ConstantThrowable extends Throwable { |
| 26 | + |
| 27 | + private String name; |
| 28 | + |
| 29 | + public ConstantThrowable() { |
| 30 | + this(null); |
| 31 | + } |
| 32 | + |
| 33 | + public ConstantThrowable(String name) { |
| 34 | + super(null, null, false, false); |
| 35 | + this.name = name; |
| 36 | + } |
| 37 | + |
| 38 | + @Override |
| 39 | + public String toString() { |
| 40 | + return name; |
| 41 | + } |
| 42 | + |
| 43 | +} |
Collapse file
Copy file name to clipboardExpand all lines: jetty-util/src/main/java/org/eclipse/jetty/util/FutureCallback.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
29 | 29 |
|
30 | 30 | public class FutureCallback implements Future<Void>,Callback |
31 | 31 | { |
32 | | - private static Throwable COMPLETED=new Throwable(); |
| 32 | + private static Throwable COMPLETED=new ConstantThrowable(); |
33 | 33 | private final AtomicBoolean _done=new AtomicBoolean(false); |
34 | 34 | private final CountDownLatch _latch=new CountDownLatch(1); |
35 | 35 | private Throwable _cause; |
|
Collapse file
Copy file name to clipboardExpand all lines: jetty-util/src/main/java/org/eclipse/jetty/util/FuturePromise.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
29 | 29 |
|
30 | 30 | public class FuturePromise<C> implements Future<C>,Promise<C> |
31 | 31 | { |
32 | | - private static Throwable COMPLETED=new Throwable(); |
| 32 | + private static Throwable COMPLETED=new ConstantThrowable(); |
33 | 33 | private final AtomicBoolean _done=new AtomicBoolean(false); |
34 | 34 | private final CountDownLatch _latch=new CountDownLatch(1); |
35 | 35 | private Throwable _cause; |
|
Collapse file
Copy file name to clipboardExpand all lines: jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java +5-26Lines changed: 5 additions & 26 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -54,33 +54,12 @@ public class SharedBlockingCallback |
54 | 54 | final Condition _idle = _lock.newCondition(); |
55 | 55 | final Condition _complete = _lock.newCondition(); |
56 | 56 |
|
57 | | - |
58 | | - private static Throwable IDLE = new Throwable() |
59 | | - { |
60 | | - @Override |
61 | | - public String toString() |
62 | | - { |
63 | | - return "IDLE"; |
64 | | - } |
65 | | - }; |
66 | 57 |
|
67 | | - private static Throwable SUCCEEDED = new Throwable() |
68 | | - { |
69 | | - @Override |
70 | | - public String toString() |
71 | | - { |
72 | | - return "SUCCEEDED"; |
73 | | - } |
74 | | - }; |
75 | | - |
76 | | - private static Throwable FAILED = new Throwable() |
77 | | - { |
78 | | - @Override |
79 | | - public String toString() |
80 | | - { |
81 | | - return "FAILED"; |
82 | | - } |
83 | | - }; |
| 58 | + private static Throwable IDLE = new ConstantThrowable("IDLE"); |
| 59 | + |
| 60 | + private static Throwable SUCCEEDED = new ConstantThrowable("SUCCEEDED"); |
| 61 | + |
| 62 | + private static Throwable FAILED = new ConstantThrowable("FAILED"); |
84 | 63 |
|
85 | 64 | Blocker _blocker; |
86 | 65 |
|
|