Tabnine Logo
IllegalStateException.printStackTrace
Code IndexAdd Tabnine to your IDE (free)

How to use
printStackTrace
method
in
java.lang.IllegalStateException

Best Java code snippets using java.lang.IllegalStateException.printStackTrace (Showing top 20 results out of 1,836)

origin: reactive-streams/reactive-streams-jvm

 @Override public void onComplete() {
  if (subscription == null) { // Technically this check is not needed, since we are expecting Publishers to conform to the spec
   (new IllegalStateException("Publisher violated the Reactive Streams rule 1.09 signalling onComplete prior to onSubscribe.")).printStackTrace(System.err);
  } else {
   // Here we are not allowed to call any methods on the `Subscription` or the `Publisher`, as per rule 2.3
   // And anyway, the `Subscription` is considered to be cancelled if this method gets called, as per rule 2.4
  }
 }
}
origin: reactive-streams/reactive-streams-jvm

@Override public void onError(final Throwable t) {
 if (subscription == null) { // Technically this check is not needed, since we are expecting Publishers to conform to the spec
  (new IllegalStateException("Publisher violated the Reactive Streams rule 1.09 signalling onError prior to onSubscribe.")).printStackTrace(System.err);
 } else {
  // As per rule 2.13, we need to throw a `java.lang.NullPointerException` if the `Throwable` is `null`
  if (t == null) throw null;
  // Here we are not allowed to call any methods on the `Subscription` or the `Publisher`, as per rule 2.3
  // And anyway, the `Subscription` is considered to be cancelled if this method gets called, as per rule 2.4
 }
}
origin: libgdx/libgdx

public void setPosition (float position) {
  if (player == null) return;
  try {
    if (!isPrepared) {
      player.prepare();
      isPrepared = true;
    }
    player.seekTo((int)(position * 1000));
  } catch (IllegalStateException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }
}
origin: libgdx/libgdx

public void setPosition (float position) {
  if (player == null) return;
  try {
    if (!isPrepared) {
      player.prepare();
      isPrepared = true;
    }
    player.seekTo((int)(position * 1000));
  } catch (IllegalStateException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }
}
origin: libgdx/libgdx

@Override
public void play () {
  if (player == null) return;
  try {
    if (player.isPlaying()) return;
  } catch (Exception e) {
    // NOTE: isPlaying() can potentially throw an exception and crash the application
    e.printStackTrace();
    return;
  }
  try {
    if (!isPrepared) {
      player.prepare();
      isPrepared = true;
    }
    player.start();
  } catch (IllegalStateException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }
}
origin: libgdx/libgdx

@Override
public void play () {
  if (player == null) return;
  try {
    if (player.isPlaying()) return;
  } catch (Exception e) {
    // NOTE: isPlaying() can potentially throw an exception and crash the application
    e.printStackTrace();
    return;
  }
  try {
    if (!isPrepared) {
      player.prepare();
      isPrepared = true;
    }
    player.start();
  } catch (IllegalStateException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }
}
origin: lipangit/JiaoZiVideoPlayer

  public long getDuration() {
    long duration = 0;
    //TODO MediaPlayer 判空的问题
//        if (JZMediaManager.instance().mediaPlayer == null) return duration;
    try {
      duration = JZMediaManager.getDuration();
    } catch (IllegalStateException e) {
      e.printStackTrace();
      return duration;
    }
    return duration;
  }

origin: lipangit/JiaoZiVideoPlayer

@Override
public void seekTo(long time) {
  try {
    mediaPlayer.seekTo((int) time);
  } catch (IllegalStateException e) {
    e.printStackTrace();
  }
}
origin: reactive-streams/reactive-streams-jvm

private void done() {
 //On this line we could add a guard against `!done`, but since rule 3.7 says that `Subscription.cancel()` is idempotent, we don't need to.
 done = true; // If we `whenNext` throws an exception, let's consider ourselves done (not accepting more elements)
 try {
  subscription.cancel(); // Cancel the subscription
 } catch(final Throwable t) {
  //Subscription.cancel is not allowed to throw an exception, according to rule 3.15
  (new IllegalStateException(subscription + " violated the Reactive Streams rule 3.15 by throwing an exception from cancel.", t)).printStackTrace(System.err);
 }
}
origin: reactive-streams/reactive-streams-jvm

private final void done() {
 //On this line we could add a guard against `!done`, but since rule 3.7 says that `Subscription.cancel()` is idempotent, we don't need to.
 done = true; // If `whenNext` throws an exception, let's consider ourselves done (not accepting more elements)
 if (subscription != null) { // If we are bailing out before we got a `Subscription` there's little need for cancelling it.
  try {
   subscription.cancel(); // Cancel the subscription
  } catch(final Throwable t) {
   //Subscription.cancel is not allowed to throw an exception, according to rule 3.15
   (new IllegalStateException(subscription + " violated the Reactive Streams rule 3.15 by throwing an exception from cancel.", t)).printStackTrace(System.err);
  }
 }
}
origin: reactive-streams/reactive-streams-jvm

private void handleOnError(final Throwable error) {
 if (subscription == null) { // Technically this check is not needed, since we are expecting Publishers to conform to the spec
  // Publisher is not allowed to signal onError before onSubscribe according to rule 1.09
  (new IllegalStateException("Publisher violated the Reactive Streams rule 1.09 signalling onError prior to onSubscribe.")).printStackTrace(System.err);
 } else {
  done = true; // Obey rule 2.4
  whenError(error);
 }
}
origin: naman14/Timber

public void setVolume(final float vol) {
  try {
    mCurrentMediaPlayer.setVolume(vol, vol);
  } catch (IllegalStateException e) {
    e.printStackTrace();
  }
}
origin: reactive-streams/reactive-streams-jvm

private void handleOnComplete() {
 if (subscription == null) { // Technically this check is not needed, since we are expecting Publishers to conform to the spec
  // Publisher is not allowed to signal onComplete before onSubscribe according to rule 1.09
  (new IllegalStateException("Publisher violated the Reactive Streams rule 1.09 signalling onComplete prior to onSubscribe.")).printStackTrace(System.err);
 } else {
  done = true; // Obey rule 2.4
  whenComplete();
 }
}
origin: lipangit/JiaoZiVideoPlayer

public long getCurrentPositionWhenPlaying() {
  long position = 0;
  //TODO 这块的判断应该根据MediaPlayer来
  if (currentState == CURRENT_STATE_PLAYING ||
      currentState == CURRENT_STATE_PAUSE) {
    try {
      position = JZMediaManager.getCurrentPosition();
    } catch (IllegalStateException e) {
      e.printStackTrace();
      return position;
    }
  }
  return position;
}
origin: JessYanCoding/MVPArms

@Override
public void onDestroyView() {
  if (mUnbinder != null && mUnbinder != Unbinder.EMPTY) {
    try {
      mUnbinder.unbind();
    } catch (IllegalStateException e) {
      e.printStackTrace();
      //fix Bindings already cleared
      Timber.w("onDestroyView: " + e.getMessage());
    }
  }
}
origin: reactive-streams/reactive-streams-jvm

 @Override public void onComplete() {
  if (subscription == null) { // Technically this check is not needed, since we are expecting Publishers to conform to the spec
   (new IllegalStateException("Publisher violated the Reactive Streams rule 1.09 signalling onComplete prior to onSubscribe.")).printStackTrace(System.err);
  } else {
   // Here we are not allowed to call any methods on the `Subscription` or the `Publisher`, as per rule 2.3
   // And anyway, the `Subscription` is considered to be cancelled if this method gets called, as per rule 2.4
  }
 }
}
origin: reactive-streams/reactive-streams-jvm

@Override public void onError(final Throwable t) {
 if (subscription == null) { // Technically this check is not needed, since we are expecting Publishers to conform to the spec
  (new IllegalStateException("Publisher violated the Reactive Streams rule 1.09 signalling onError prior to onSubscribe.")).printStackTrace(System.err);
 } else {
  // As per rule 2.13, we need to throw a `java.lang.NullPointerException` if the `Throwable` is `null`
  if (t == null) throw null;
  // Here we are not allowed to call any methods on the `Subscription` or the `Publisher`, as per rule 2.3
  // And anyway, the `Subscription` is considered to be cancelled if this method gets called, as per rule 2.4
 }
}
origin: naman14/Timber

public void setDataSource(final String path) {
  try {
    mIsInitialized = setDataSourceImpl(mCurrentMediaPlayer, path);
    if (mIsInitialized) {
      setNextDataSource(null);
    }
  } catch (IllegalStateException e) {
    e.printStackTrace();
  }
}
origin: reactive-streams/reactive-streams-jvm

private void done() {
 //On this line we could add a guard against `!done`, but since rule 3.7 says that `Subscription.cancel()` is idempotent, we don't need to.
 done = true; // If we `whenNext` throws an exception, let's consider ourselves done (not accepting more elements)
 try {
  subscription.cancel(); // Cancel the subscription
 } catch(final Throwable t) {
  //Subscription.cancel is not allowed to throw an exception, according to rule 3.15
  (new IllegalStateException(subscription + " violated the Reactive Streams rule 3.15 by throwing an exception from cancel.", t)).printStackTrace(System.err);
 }
}
origin: spring-projects/spring-framework

  @Override
  public Object invoke(MethodInvocation mi) throws Throwable {
    String task = "get invocation on way IN";
    try {
      MethodInvocation current = ExposeInvocationInterceptor.currentInvocation();
      assertEquals(mi.getMethod(), current.getMethod());
      Object retval = mi.proceed();
      task = "get invocation on way OUT";
      assertEquals(current, ExposeInvocationInterceptor.currentInvocation());
      return retval;
    }
    catch (IllegalStateException ex) {
      System.err.println(task + " for " + mi.getMethod());
      ex.printStackTrace();
      throw ex;
    }
  }
}
java.langIllegalStateExceptionprintStackTrace

Popular methods of IllegalStateException

  • <init>
    Constructs a new IllegalStateException with the current stack trace and the specified cause.
  • getMessage
  • initCause
  • getStackTrace
  • setStackTrace
  • getCause
  • toString
  • addSuppressed
  • getLocalizedMessage
  • fillInStackTrace
  • getSuppressed
  • getSuppressed

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • From CI to AI: The AI layer in your organization
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