Class Util

java.lang.Object
org.robolectric.util.Util

public class Util extends Object
Generic collection of utility methods.
  • Constructor Details

    • Util

      public Util()
  • Method Details

    • pathFrom

      public static Path pathFrom(URL localArtifactUrl)
    • sneakyThrow

      public static <T extends Throwable> RuntimeException sneakyThrow(Throwable t) throws T
      Re-throw t (even if it's a checked exception) without requiring a throws declaration.

      This function declares a return type of RuntimeException but will never actually return a value. This allows you to use it with a throw statement to convince the compiler that the current branch will not complete.

      
       throw Util.sneakyThrow(new IOException());
       

      Adapted from https://www.mail-archive.com/javaposse@googlegroups.com/msg05984.html

      Throws:
      T