Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,268 for throw (0.17 sec)

  1. android/guava/src/com/google/common/io/Closeables.java

       *   SomeStream stream = new SomeStream("foo");
       *   boolean threw = true;
       *   try {
       *     // ... code which does something with the stream ...
       *     threw = false;
       *   } finally {
       *     // If an exception occurs, rethrow it only if threw==false:
       *     Closeables.close(stream, threw);
       *   }
       * }
       * }</pre>
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/base/Preconditions.java

     *
     * <p>If the precondition is not met, the {@code Preconditions} method throws an unchecked exception
     * of a specified type, which helps the method in which the exception was thrown communicate that
     * its caller has made a mistake. This allows constructs such as
     *
     * <pre>{@code
     * public static double sqrt(double value) {
     *   if (value < 0) {
     *     throw new IllegalArgumentException("input is negative: " + value);
     *   }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 11 11:52:14 GMT 2024
    - 52.9K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

          throw t;
        }
      }
    
      /** Calls threadFail with message "should throw exception". */
      public void threadShouldThrow() {
        threadFail("should throw exception");
      }
    
      /** Calls threadFail with message "should throw" + exceptionName. */
      public void threadShouldThrow(String exceptionName) {
        threadFail("should throw " + exceptionName);
      }
    
      /**
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 37.7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java

          cause.setStackTrace(combined);
        }
        if (cause instanceof Exception) {
          throw (Exception) cause;
        }
        if (cause instanceof Error) {
          throw (Error) cause;
        }
        // The cause is a weird kind of Throwable, so throw the outer exception.
        throw e;
      }
    
      private static Set<Method> findInterruptibleMethods(Class<?> interfaceType) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jun 27 14:21:11 GMT 2023
    - 9.7K bytes
    - Viewed (0)
  5. guava-testlib/src/com/google/common/collect/testing/AbstractIteratorTester.java

          if (!features.contains(methodFeature)) {
            if (stackWithLastReturnedElementAtTop == null) {
              throw PermittedMetaException.UOE_OR_ISE;
            } else {
              throw PermittedMetaException.UOE;
            }
          } else if (stackWithLastReturnedElementAtTop == null) {
            throw PermittedMetaException.ISE;
          }
        }
    
        private List<E> getElements() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 21.3K bytes
    - Viewed (0)
  6. guava/src/com/google/common/base/Throwables.java

       *   throwIfUnchecked(failure);
       *   throw new AssertionError(failure);
       * }
       * </pre>
       *
       * @since 20.0
       */
      public static void throwIfUnchecked(Throwable throwable) {
        checkNotNull(throwable);
        if (throwable instanceof RuntimeException) {
          throw (RuntimeException) throwable;
        }
        if (throwable instanceof Error) {
          throw (Error) throwable;
        }
      }
    
      /**
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Wed Mar 06 15:38:58 GMT 2024
    - 20.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/base/Throwables.java

       *   throwIfUnchecked(failure);
       *   throw new AssertionError(failure);
       * }
       * </pre>
       *
       * @since 20.0
       */
      public static void throwIfUnchecked(Throwable throwable) {
        checkNotNull(throwable);
        if (throwable instanceof RuntimeException) {
          throw (RuntimeException) throwable;
        }
        if (throwable instanceof Error) {
          throw (Error) throwable;
        }
      }
    
      /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Mar 06 15:38:58 GMT 2024
    - 20.6K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java

                            throw new UnsupportedOperationException();
                          }
    
                          @Override
                          public Iterator<String> iterator() {
                            throw new UnsupportedOperationException();
                          }
    
                          @Override
                          public boolean removeAll(Collection<?> collection) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 17 15:49:06 GMT 2023
    - 11.8K bytes
    - Viewed (0)
  9. guava/src/com/google/common/collect/ImmutableRangeMap.java

      @DoNotCall("Always throws UnsupportedOperationException")
      public final void putCoalescing(Range<K> range, V value) {
        throw new UnsupportedOperationException();
      }
    
      /**
       * Guaranteed to throw an exception and leave the {@code RangeMap} unmodified.
       *
       * @throws UnsupportedOperationException always
       * @deprecated Unsupported operation.
       */
      @Deprecated
      @Override
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 14.7K bytes
    - Viewed (0)
  10. guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java

      public static class TwoArg {
        /** Action to take on a null param. */
        public enum Action {
          THROW_A_NPE {
            @Override
            public void act() {
              throw new NullPointerException();
            }
          },
          THROW_OTHER {
            @Override
            public void act() {
              throw new FooException();
            }
          },
          JUST_RETURN {
            @Override
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Nov 16 15:12:31 GMT 2023
    - 47.9K bytes
    - Viewed (0)
Back to top