com.sun.org.apache.xml.internal.utils.WrappedRuntimeException Java Examples

The following examples show how to use com.sun.org.apache.xml.internal.utils.WrappedRuntimeException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IteratorPool.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #2
Source File: IteratorPool.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #3
Source File: IteratorPool.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #4
Source File: IteratorPool.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #5
Source File: IteratorPool.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #6
Source File: IteratorPool.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #7
Source File: IteratorPool.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #8
Source File: IteratorPool.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #9
Source File: IteratorPool.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #10
Source File: IteratorPool.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #11
Source File: IteratorPool.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Get an instance of the given object in this pool
 *
 * @return An instance of the given object
 */
public synchronized DTMIterator getInstance()
{
  // Check if the pool is empty.
  if (m_freeStack.isEmpty())
  {

    // Create a new object if so.
    try
    {
      return (DTMIterator)m_orig.clone();
    }
    catch (Exception ex)
    {
      throw new WrappedRuntimeException(ex);
    }
  }
  else
  {
    // Remove object from end of free pool.
    DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
    return result;
  }
}
 
Example #12
Source File: SAX2DTM.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #13
Source File: SAX2DTM.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #14
Source File: SAX2DTM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #15
Source File: SAX2DTM.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #16
Source File: SAX2DTM.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #17
Source File: SAX2DTM.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #18
Source File: SAX2DTM.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #19
Source File: SAX2DTM.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #20
Source File: SAX2DTM.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #21
Source File: SAX2DTM.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}
 
Example #22
Source File: SAX2DTM.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This method should try and build one or more nodes in the table.
 *
 * @return The true if a next node is found or false if
 *         there are no more nodes.
 */
protected boolean nextNode()
{

  if (null == m_incrementalSAXSource)
    return false;

  if (m_endDocumentOccured)
  {
    clearCoRoutine();

    return false;
  }

  Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);

  // gotMore may be a Boolean (TRUE if still parsing, FALSE if
  // EOF) or an exception if IncrementalSAXSource malfunctioned
  // (code error rather than user error).
  //
  // %REVIEW% Currently the ErrorHandlers sketched herein are
  // no-ops, so I'm going to initially leave this also as a
  // no-op.
  if (!(gotMore instanceof Boolean))
  {
    if(gotMore instanceof RuntimeException)
    {
      throw (RuntimeException)gotMore;
    }
    else if(gotMore instanceof Exception)
    {
      throw new WrappedRuntimeException((Exception)gotMore);
    }
    // for now...
    clearCoRoutine();

    return false;

    // %TBD%
  }

  if (gotMore != Boolean.TRUE)
  {

    // EOF reached without satisfying the request
    clearCoRoutine();  // Drop connection, stop trying

    // %TBD% deregister as its listener?
  }

  return true;
}