GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • jetty-continuation/src/main/java/org/eclipse/jetty/continuation
    • ContinuationThrowable.java
  • jetty-util/src/main/java/org/eclipse/jetty/util
    • BlockingCallback.java
    • ConstantThrowable.java
    • FutureCallback.java
    • FuturePromise.java
    • SharedBlockingCallback.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationThrowable.java‎

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 numberDiff line numberDiff line change
@@ -43,4 +43,9 @@
4343
* </p>
4444
*/
4545
public class ContinuationThrowable extends Error
46-
{}
46+
{
47+
public ContinuationThrowable()
48+
{
49+
super(null, null, false, false);
50+
}
51+
}
Collapse file

‎jetty-util/src/main/java/org/eclipse/jetty/util/BlockingCallback.java‎

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 numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ public class BlockingCallback implements Callback
3636
{
3737
private static final Logger LOG = Log.getLogger(BlockingCallback.class);
3838

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");
4440

4541
private final CountDownLatch _latch = new CountDownLatch(1);
4642
private final AtomicReference<Throwable> _state = new AtomicReference<>();
Collapse file

‎jetty-util/src/main/java/org/eclipse/jetty/util/ConstantThrowable.java‎

Copy file name to clipboard
+43Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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

‎jetty-util/src/main/java/org/eclipse/jetty/util/FutureCallback.java‎

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 numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
public class FutureCallback implements Future<Void>,Callback
3131
{
32-
private static Throwable COMPLETED=new Throwable();
32+
private static Throwable COMPLETED=new ConstantThrowable();
3333
private final AtomicBoolean _done=new AtomicBoolean(false);
3434
private final CountDownLatch _latch=new CountDownLatch(1);
3535
private Throwable _cause;
Collapse file

‎jetty-util/src/main/java/org/eclipse/jetty/util/FuturePromise.java‎

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 numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
public class FuturePromise<C> implements Future<C>,Promise<C>
3131
{
32-
private static Throwable COMPLETED=new Throwable();
32+
private static Throwable COMPLETED=new ConstantThrowable();
3333
private final AtomicBoolean _done=new AtomicBoolean(false);
3434
private final CountDownLatch _latch=new CountDownLatch(1);
3535
private Throwable _cause;
Collapse file

‎jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java‎

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 numberDiff line numberDiff line change
@@ -54,33 +54,12 @@ public class SharedBlockingCallback
5454
final Condition _idle = _lock.newCondition();
5555
final Condition _complete = _lock.newCondition();
5656

57-
58-
private static Throwable IDLE = new Throwable()
59-
{
60-
@Override
61-
public String toString()
62-
{
63-
return "IDLE";
64-
}
65-
};
6657

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");
8463

8564
Blocker _blocker;
8665

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.