Tabnine Logo
RuntimeException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
java.lang.RuntimeException
constructor

Best Java code snippets using java.lang.RuntimeException.<init> (Showing top 20 results out of 244,701)

origin: ReactiveX/RxJava

  static void sleep(int millis) {
    try {
      Thread.sleep(millis);
    } catch (InterruptedException ex) {
      throw new RuntimeException(ex);
    }
  }
}
origin: iluwatar/java-design-patterns

@Override
public void run() {
 try (Socket socket = new Socket(InetAddress.getLocalHost(), serverPort)) {
  OutputStream outputStream = socket.getOutputStream();
  PrintWriter writer = new PrintWriter(outputStream);
  sendLogRequests(writer, socket.getInputStream());
 } catch (IOException e) {
  LOGGER.error("error sending requests", e);
  throw new RuntimeException(e);
 }
}
origin: ReactiveX/RxJava

  @Override
  public SingleSource<Integer> apply(final Integer integer) throws Exception {
    throw new RuntimeException("something went terribly wrong!");
  }
})
origin: ReactiveX/RxJava

  @Override
  public Throwable call() {
    return new RuntimeException();
  }
});
origin: ReactiveX/RxJava

  @Override
  public R apply(T t1) {
    throw new RuntimeException("Forced failure");
  }
};
origin: ReactiveX/RxJava

  @Override
  public void run() {
    throw new RuntimeException("failed on second one too");
  }
}));
origin: ReactiveX/RxJava

  @Override
  public void accept(Long n) {
    throw new RuntimeException();
  }
};
origin: ReactiveX/RxJava

  @Override
  public void onNext(Long args) {
    throw new RuntimeException("forced failure");
  }
};
origin: ReactiveX/RxJava

  @Override
  public void onNext(Long args) {
    throw new RuntimeException("forced failure");
  }
};
origin: ReactiveX/RxJava

  @Override
  public Map<Integer, Collection<String>> call() {
    throw new RuntimeException("Forced failure");
  }
};
origin: ReactiveX/RxJava

public void waitToFinish() {
  try {
    t.join();
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
origin: ReactiveX/RxJava

  public void waitToFinish() {
    try {
      t.join();
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
}
origin: ReactiveX/RxJava

protected void captureMaxThreads() {
  int concurrentThreads = threadsRunning.get();
  int maxThreads = maxConcurrentThreads.get();
  if (concurrentThreads > maxThreads) {
    maxConcurrentThreads.compareAndSet(maxThreads, concurrentThreads);
    if (concurrentThreads > 1) {
      new RuntimeException("should not be greater than 1").printStackTrace();
    }
  }
}
origin: ReactiveX/RxJava

  @Override
  public Observable<?> apply(Observable<? extends Throwable> t1) {
    return Observable.error(new RuntimeException());
  }
}).subscribe(observer);
origin: ReactiveX/RxJava

@Test
public void badException() {
  Throwable e = new BadException();
  assertSame(e, new CompositeException(e).getCause().getCause());
  assertSame(e, new CompositeException(new RuntimeException(e)).getCause().getCause().getCause());
}
origin: ReactiveX/RxJava

@Test
public void ambIterableOrder() {
  Completable error = Completable.error(new RuntimeException());
  Completable.amb(Arrays.asList(Completable.complete(), error)).test().assertComplete();
}
origin: ReactiveX/RxJava

@Test
public void assertNotSubscribed() {
  TestObserver<Integer> to = new TestObserver<Integer>();
  to.assertNotSubscribed();
  to.errors().add(new TestException());
  try {
    to.assertNotSubscribed();
    throw new RuntimeException("Should have thrown!");
  } catch (AssertionError ex) {
    // expected
  }
}
origin: ReactiveX/RxJava

@Test
public void assertValueSetOnlyThrowsWhenCompleted() {
  TestObserver<Integer> to = TestObserver.create();
  to.onSubscribe(Disposables.empty());
  to.onComplete();
  try {
    to.assertValueSetOnly(Collections.<Integer>emptySet());
    throw new RuntimeException();
  } catch (AssertionError ex) {
    // expected
  }
}
origin: ReactiveX/RxJava

@Test
public void singleOrErrorError() {
  Observable.error(new RuntimeException("error"))
    .singleOrError()
    .test()
    .assertNoValues()
    .assertErrorMessage("error")
    .assertError(RuntimeException.class);
}
origin: ReactiveX/RxJava

@Test
public void ambWithOrder() {
  Flowable<Integer> error = Flowable.error(new RuntimeException());
  Flowable.just(1).ambWith(error).test().assertValue(1).assertComplete();
}
java.langRuntimeException<init>

Javadoc

Constructs a new RuntimeException that includes the current stack trace.

Popular methods of RuntimeException

  • getMessage
  • printStackTrace
  • getCause
  • toString
  • getStackTrace
  • initCause
  • setStackTrace
  • getLocalizedMessage
  • fillInStackTrace
  • addSuppressed
  • getSuppressed
  • getSuppressed

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • 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