Skip to content

Import ExceptionMapper - #29

Open
rovarga wants to merge 23 commits into
opendaylight:masterfrom
rovarga:import-em
Open

Import ExceptionMapper#29
rovarga wants to merge 23 commits into
opendaylight:masterfrom
rovarga:import-em

Conversation

@rovarga

@rovarga rovarga commented Aug 23, 2026

Copy link
Copy Markdown
Contributor
  • Initial empty repository
  • Bug 1392: New yang-common/util classes
  • BUG-1469: introduce ReflectiveExceptionMapper
  • Fix license header violations in common/util
  • Organize Imports to be Checkstyle compliant in utils
  • Checkstyle clean up about 200 trivial violation
  • Address trivial eclipse warnings
  • Fix eclipse/checkstyle warnings
  • Remove explicit default super-constructor calls
  • Cleanup use of Guava library
  • Fix FindBugs violations and enable enforcement in utils
  • Do not declare runtime exceptions
  • Add @SuppressModernizer
  • Update ExceptionMapper documentation
  • Use assertThrows() in common-util
  • Use @serial in util
  • Clean up ExceptionMapper
  • Migrate common/util to JUnit5
  • Remove more unused @SuppressFBWarnings
  • Remove an unused SpotBugs suppression
  • Modernize ExceptionMapper
  • Deprecate ReflectiveExceptionMapper

tykeal and others added 23 commits July 18, 2013 22:42
Needed for https://git.opendaylight.org/gerrit/#/c/9178/

OperationFailedException:

   Generalized exception class that contains an RpcError list.

MappingCheckedFuture:

   Futures#addCallback and Futures#transform call Future#get but
   CheckedFuture doesn't override the get methods to translate exceptions
   to the checked type. Thus you don't get the checked exception when using
   those Futures methods. This kind of defeats the purpose of CheckedFuture.

   The new MappingCheckedFuture class overrides the get methods to translate exceptions.

ExceptionMapper:

   Generalized class for use with CheckedFuture to translate exceptions to a
   specified exception type.

Change-Id: Idb4c7e8b5c2cf17795de2f3af4278989ac7bd116
Signed-off-by: tpantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Convenience class for use when simple instantiation is acceptable and
the mapper instance can be shared.

Change-Id: I1946155a46b94fda5067ccbffcbf3b72f2ce8e3d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Change-Id: I4d26740f5a29b65f522cc1e779d8dfc226dd986a
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Change-Id: I7bf2721ea5cbe310d73fd1f5f7784395bd44d871
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
I've intentionally started with the very simple formatting type changes
here.  This does not take care of everything yet, but it's a start.
Hopefully sending a few batches also makes it easier  (AssertionError e)
{to review.

Change-Id: Ibf328746c6880138a56eb36837bc8e789647b9bd
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
- missing javadoc
- superfluous else branches
- checkstyle violations

Change-Id: Ibf74b95d6ae7d1c9889852f541cce3e9d6b28bb4
Signed-off-by: Robert Varga <rovarga@cisco.com>
concepts/util should have their checkstyle enforced.

Change-Id: I752ce3c75e69446a1284b511b5221553d7187bb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
The default constructor is called by default (hence its name), no need
to call it explicitly. Based on this commit [1].

[1] https://git.opendaylight.org/gerrit/#/c/63526/

Change-Id: I0feaf3747fcad25082d74cdb9cc4032180cfba18
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
Turn Preconditions.checkNotNull into Objects.requireNonNull, use it
as static import. Eliminate the use of Optional/Function/Supplier
concepts, which are now native to Java 8.

Change-Id: Ie470283e1b4f706b0601a191626bd1e036d4d723
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Change-Id: I35eff969e51d6ec9b4f4b79b1b8cb2af9b9a8150
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
This is to keep sonar happy.

Change-Id: I306cbab1a471e6aec17e4abc76282766c72164d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
We are mucking with modernizable constructs on purpose, add
suppressions to keep modernizer quiet.

Change-Id: Ia25640be14f1943a976c4edda6247124986a9d15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Do not link Futures.makeChecked(), as that is going away. Also
reformat the documentation to be more readable.

Change-Id: I67042feba8ac407b9a1f31f875e0284327637fc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Using assertThrows() allows us to clean up some of the tests, so that
we do not have needed flow control and expected= tests.

Change-Id: I0b2ca1af3a50109ea68e0161c70f918b76275fb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
This improves code safety quite a bit and allows us to perform a
long-needed audit.

Change-Id: I04161cfe8e6a367e1ae0d53a2628fbf72035ecde
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Use Class.isInstance() and Class.cast() instead of unchecked casts. Also
restructure ExecutionException mapping.

Change-Id: I21b61cd99a715746c865d12b378b1874b925519b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Migrated all tests to use JUnit5 Assertions, using
openrewrite:rewrite-testing-frameworks.

JIRA: YANGTOOLS-1521
Change-Id: I175e6fb628a1f1375e70ff8c93f1b1028ccf4ce6
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Upgraded SpotBugs no longer reports a few false positives. Remove
a few more of the superfluous suppressions.

Change-Id: I4274a18c3d75a768a55ff80df9baf85095510af1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
SpotBugs no longer calls out ExceptionMapper's cast, so let's remove the
suppression.

Change-Id: I0d9c365c4f840d508af36b66edca73065b47cfcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Dispense some TLC:
- sprinkle some @nonnulls where we can guarantee them
- use switch to dispatch exception types
- use pom.xml-based modernizer suppression, reducing annotation
  leakage

Change-Id: Iaba717c126b653490298a8b54f1af26051734e42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
This class is not used anywhere: deprecate it for removal, as we
want to discourage use of java.lang.reflect.

Change-Id: Iad97db6b2666c372e685b5c8ed7b48aaee089b91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
This imports ExceptionMapper from yangtools along with its history.

Change-Id: Ibc44f70ac76e0583b4b95ebb182be1d9cf046075
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants