Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Woodstox 6.4.0 - Source Code Files
Woodstox 6.4.0 Source Code Files are provided at the Woodstox GitHub Website.
You can download them from the "src/main/java" folder.
You can also browse Woodstox Source Code files below:
✍: FYIcenter
⏎ com/ctc/wstx/util/ExceptionUtil.java
package com.ctc.wstx.util;
import java.io.IOException;
public final class ExceptionUtil
{
private ExceptionUtil() { }
/**
* Method that can be used to convert any Throwable to a RuntimeException;
* conversion is only done for checked exceptions.
*/
public static void throwRuntimeException(Throwable t)
{
// Unchecked? Can re-throw as is
throwIfUnchecked(t);
// Otherwise, let's just change its type:
throw new RuntimeException("[was "+t.getClass()+"] "+t.getMessage(), t);
}
public static IOException constructIOException(String msg, Throwable src)
{
/* Stupid IOException constructors... only 1.6 has
* what we need. Hence must set root cause explicitly
* as we have to support JDK 1.5.
*/
IOException e = new IOException(msg);
setInitCause(e, src);
return e;
}
public static void throwAsIllegalArgument(Throwable t)
{
// Unchecked? Can re-throw as is
throwIfUnchecked(t);
// Otherwise, let's just change its type:
IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage());
// And indicate the root cause
setInitCause(rex, t);
throw rex;
}
public static void throwIfUnchecked(Throwable t)
{
// If it's not checked, let's throw it as is
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
if (t instanceof Error) {
throw (Error) t;
}
}
/**
* This method is just added for convenience, and only to be used for
* assertion style of exceptions. For errors that actually occur, method
* with the string arg should be called instead.
*/
public static void throwGenericInternal()
{
throwInternal(null);
}
public static void throwInternal(String msg)
{
if (msg == null) {
msg = "[no description]";
}
throw new RuntimeException("Internal error: "+msg);
}
public static void setInitCause(Throwable newT, Throwable rootT)
{
/* [WSTX-110]: Better make sure we do not already have
* a chained exception...
*/
if (newT.getCause() == null) {
newT.initCause(rootT);
}
}
}
⏎ com/ctc/wstx/util/ExceptionUtil.java
Or download all of them as a single archive file:
File name: woodstox-core-6.4.0-fyi.zip File size: 552992 bytes Release date: 2022-10-25 Download
⇒ woodstox-core-6.4.0.jar - Woodstox Core 6.4.0
⇐ What Is Woodstox XML Processing
2023-01-29, ≈45🔥, 0💬
Popular Posts:
How to merge two JAR files with "jar" commands? I am tired of specifying multiple JAR files in the c...
What JAR files are required to run dom\Counter.java provided in the Apache Xerces package? You can f...
Apache Commons CLI Source Code Files are provided in the source package file commons-cli-1.5.0-sourc. ..
JDK 11 jdk.internal.vm.compiler .jmodis the JMOD file for JDK 11 Internal VM Compiler module. JDK 11...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...