Tabnine Logo
UnsupportedOperationException.getCause
Code IndexAdd Tabnine to your IDE (free)

How to use
getCause
method
in
java.lang.UnsupportedOperationException

Best Java code snippets using java.lang.UnsupportedOperationException.getCause (Showing top 20 results out of 315)

origin: reactor/reactor-core

@Override
public void onError(Throwable t) {
  if (done) {
    Operators.onErrorDropped(t, cachedContext);
    return;
  }
  done = true;
  try {
    //noinspection ConstantConditions
    onSignal.accept(Signal.error(t, cachedContext));
  }
  catch (Throwable e) {
    //this performs a throwIfFatal or suppresses t in e
    t = Operators.onOperatorError(null, e, t, cachedContext);
  }
  try {
    actual.onError(t);
  }
  catch (UnsupportedOperationException use) {
    if (!Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
      throw use;
    }
    //ignore if missing callback
  }
}
origin: reactor/reactor-core

@Test
public void onErrorCallbackNotImplemented() {
  Flux<String> flux = Flux.error(new IllegalStateException());
  try {
    flux.subscribe(new BaseSubscriber<String>() {
      @Override
      protected void hookOnSubscribe(Subscription subscription) {
        request(1);
      }
      @Override
      protected void hookOnNext(String value) {
        //NO-OP
      }
    });
    fail("expected UnsupportedOperationException");
  }
  catch (UnsupportedOperationException e) {
    assertThat(e.getClass()
          .getSimpleName(), is("ErrorCallbackNotImplemented"));
    assertThat(e.getCause(), is(instanceOf(IllegalStateException.class)));
  }
}
origin: spring-projects/spring-framework

@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
@Test
public void cacheExceptionRewriteCallStack() {
  final String keyItem = name.getMethodName();
  UnsupportedOperationException first = null;
  long ref = service.exceptionInvocations();
  try {
    service.cacheWithException(keyItem, true);
    fail("Should have thrown an exception");
  }
  catch (UnsupportedOperationException e) {
    first = e;
  }
  // Sanity check, this particular call has called the service
  assertEquals("First call should not have been cached", ref + 1, service.exceptionInvocations());
  UnsupportedOperationException second = methodInCallStack(keyItem);
  // Sanity check, this particular call has *not* called the service
  assertEquals("Second call should have been cached", ref + 1, service.exceptionInvocations());
  assertEquals(first.getCause(), second.getCause());
  assertEquals(first.getMessage(), second.getMessage());
  assertFalse("Original stack must not contain any reference to methodInCallStack",
      contain(first, AbstractJCacheAnnotationTests.class.getName(), "methodInCallStack"));
  assertTrue("Cached stack should have been rewritten with a reference to  methodInCallStack",
      contain(second, AbstractJCacheAnnotationTests.class.getName(), "methodInCallStack"));
}
origin: reactor/reactor-core

  !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
throw use;
origin: reactor/reactor-core

  || !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
throw use;
origin: reactor/reactor-core

  || !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t){
throw use;
origin: reactor/reactor-core

  || !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
throw use;
origin: reactor/reactor-core

  || !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
throw use;
origin: jenkinsci/workflow-step-api-plugin

} catch (UnsupportedOperationException x) {
  if (!(x.getCause() instanceof NoStaplerConstructorException)) {
    LOG.log(Level.WARNING, "failed to uncoerce " + o, x);
origin: org.jenkins-ci.plugins.workflow/workflow-step-api

} catch (UnsupportedOperationException x) {
  if (!(x.getCause() instanceof NoStaplerConstructorException)) {
    LOG.log(Level.WARNING, "failed to uncoerce " + o, x);
origin: fbacchella/LogHub

public synchronized Object eval(Event event) throws ProcessorException {
  logger.trace("Evaluating script {} with formatters {}", expression, formatters);
  Binding groovyBinding = new Binding();
  groovyBinding.setVariable("event", event);
  groovyBinding.setVariable("formatters", formatters);
  Script localscript;
  try {
    localscript = groovyScript.get();
  } catch (UnsupportedOperationException e) {
    throw event.buildException(String.format("script compilation failed '%s': %s", expression, e.getCause().getMessage()));
  }
  localscript.setBinding(groovyBinding);
  try {
    return localscript.run();
  } catch (Exception e) {
    throw event.buildException(String.format("failed expression '%s': %s", expression, Helpers.resolveThrowableException(e)));
  } finally {
    localscript.setBinding(EMPTYBIDDING);
  }
}
origin: io.projectreactor/reactor-core

@Override
public void onError(Throwable t) {
  if (done) {
    Operators.onErrorDropped(t, cachedContext);
    return;
  }
  done = true;
  try {
    //noinspection ConstantConditions
    onSignal.accept(Signal.error(t, cachedContext));
  }
  catch (Throwable e) {
    //this performs a throwIfFatal or suppresses t in e
    t = Operators.onOperatorError(null, e, t, cachedContext);
  }
  try {
    actual.onError(t);
  }
  catch (UnsupportedOperationException use) {
    if (!Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
      throw use;
    }
    //ignore if missing callback
  }
}
origin: ldp4j/ldp4j

@Test
public void testAs$notSupported() throws Exception {
  try {
    term().as(Double.class);
    fail("Should not cast to Double");
  } catch (UnsupportedOperationException e) {
    assertThat(e.getCause(),instanceOf(CannotAdaptClassesException.class));
  }
}
origin: io.projectreactor/reactor-core

  || !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t){
throw use;
origin: io.projectreactor/reactor-core

  !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
throw use;
origin: io.projectreactor/reactor-core

  || !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
throw use;
origin: io.projectreactor/reactor-core

  || !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
throw use;
origin: io.projectreactor/reactor-core

  || !Exceptions.isErrorCallbackNotImplemented(use) && use.getCause() != t) {
throw use;
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

/**
 * Pre-evaluate a function at compile time. Functions that do not allow
 * pre-evaluation, or that need access to context information, can override this method.
 *
 * @param visitor an expression visitor
 * @return the result of the early evaluation, or the original expression, or potentially
 * a simplified expression
 * @throws net.sf.saxon.trans.XPathException if evaluation fails
 */
public Expression preEvaluate(ExpressionVisitor visitor) throws XPathException {
  if ((getIntrinsicDependencies() & ~StaticProperty.DEPENDS_ON_STATIC_CONTEXT) != 0) {
    return this;
  }
  try {
    Literal lit = Literal.makeLiteral(iterate(visitor.getStaticContext().makeEarlyEvaluationContext()).materialize(), this);
    Optimizer.trace(visitor.getConfiguration(), "Pre-evaluated function call " + toShortString(), lit);
    return lit;
  } catch (NoDynamicContextException e) {
    // early evaluation failed, usually because implicit timezone required
    return this;
  } catch (UnsupportedOperationException e) {
    //e.printStackTrace();
    if (e.getCause() instanceof NoDynamicContextException) {
      return this;
    } else {
      throw e;
    }
  }
}
origin: net.sf.saxon/Saxon-HE

/**
 * Pre-evaluate a function at compile time. Functions that do not allow
 * pre-evaluation, or that need access to context information, can override this method.
 *
 * @param visitor an expression visitor
 * @return the result of the early evaluation, or the original expression, or potentially
 * a simplified expression
 * @throws net.sf.saxon.trans.XPathException if evaluation fails
 */
public Expression preEvaluate(ExpressionVisitor visitor) throws XPathException {
  if ((getIntrinsicDependencies() & ~StaticProperty.DEPENDS_ON_STATIC_CONTEXT) != 0) {
    return this;
  }
  try {
    Literal lit = Literal.makeLiteral(iterate(visitor.getStaticContext().makeEarlyEvaluationContext()).materialize(), this);
    Optimizer.trace(visitor.getConfiguration(), "Pre-evaluated function call " + toShortString(), lit);
    return lit;
  } catch (NoDynamicContextException e) {
    // early evaluation failed, usually because implicit timezone required
    return this;
  } catch (UnsupportedOperationException e) {
    //e.printStackTrace();
    if (e.getCause() instanceof NoDynamicContextException) {
      return this;
    } else {
      throw e;
    }
  }
}
java.langUnsupportedOperationExceptiongetCause

Popular methods of UnsupportedOperationException

  • <init>
    Constructs a new exception with the specified cause and a detail message of (cause==null ? null : c
  • getMessage
  • getStackTrace
  • setStackTrace
  • printStackTrace
  • initCause
  • toString
  • getLocalizedMessage
  • fillInStackTrace

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Menu (java.awt)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now