• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

talsma-ict / context-propagation / #1454

28 Oct 2024 08:19PM CUT coverage: 84.389% (-10.3%) from 94.737%
#1454

Pull #510

sjoerdtalsma
Move ContextAwareCompletableFuture to core.concurrent package

Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
Pull Request #510: Add deprecations

464 of 627 new or added lines in 32 files covered. (74.0%)

12 existing lines in 3 files now uncovered.

1119 of 1326 relevant lines covered (84.39%)

0.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/context-propagation/src/main/java/nl/talsmasoftware/context/delegation/Wrapper.java
1
/*
2
 * Copyright 2016-2024 Talsma ICT
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *         http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package nl.talsmasoftware.context.delegation;
17

18
/**
19
 * Base class for wrapping a {@linkplain #delegate()} object.
20
 *
21
 * @author Sjoerd Talsma
22
 * @deprecated Moved to package {@code nl.talsmasoftware.context.core.delegation}.
23
 */
24
@Deprecated
25
public abstract class Wrapper<T> extends nl.talsmasoftware.context.core.delegation.Wrapper<T> {
26

27
    /**
28
     * Constructor providing a delegate wrapped object.
29
     *
30
     * @param delegate The delegate object being wrapped.
31
     *                 This may <strong>only</strong> be <code>null</code> if the <code>delegate()</code> method is
32
     *                 overridden to provide an alternative non-<code>null</code> result.
33
     */
34
    protected Wrapper(T delegate) {
35
        super(delegate);
1✔
36
    }
1✔
37

38
    /**
39
     * {@inheritDoc}
40
     */
41
    @Override
42
    protected T delegate() {
43
        return super.delegate();
1✔
44
    }
45

46
    /**
47
     * Accessor to provide a guaranteed non-<code>null</code> delegate instance for use within delegation method
48
     * implementations.
49
     *
50
     * @return The delegate for this wrapper (guaranteed to be non-<code>null</code>).
51
     * @throws NullPointerException with a specific message in case the delegate was null.
52
     * @deprecated This extra check will be removed in the next version,
53
     * {@linkplain #delegate()} <strong>must</strong> return non-null.
54
     */
55
    @Deprecated
56
    protected final T nonNullDelegate() {
UNCOV
57
        final T foundDelegate = delegate();
×
UNCOV
58
        if (foundDelegate == null) try {
×
UNCOV
59
            throw new NullPointerException(String.format("No delegate available for %s.", this));
×
60
        } catch (StackOverflowError toStringCallsNonNullDelegate) {
×
61
            throw new NullPointerException(String.format("No delegate available for %s.", getClass().getSimpleName()));
×
62
        }
UNCOV
63
        return foundDelegate;
×
64
    }
65
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc