Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 105 for ClassCastException (0.08 sec)

  1. guava-tests/test/com/google/common/collect/AbstractTableReadTest.java

       *
       * @param data the table data, repeating the sequence row key, column key, value once per mapping
       * @throws IllegalArgumentException if the size of {@code data} isn't a multiple of 3
       * @throws ClassCastException if a data element has the wrong type
       */
      protected abstract Table<String, Integer, C> create(@Nullable Object... data);
    
      protected void assertSize(int expectedSize) {
        assertEquals(expectedSize, table.size());
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveAllTester.java

        try {
          assertFalse(
              "removeAll(containsWrongType) should return false or throw",
              collection.removeAll(MinimalCollection.of(WrongType.VALUE)));
        } catch (ClassCastException tolerated) {
        }
        expectUnchanged();
      }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Nov 14 23:40:07 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SmbRenewableCredentialsTest.java

            }
    
            @Override
            public <T extends Credentials> T unwrap(Class<T> type) {
                if (type.isInstance(this)) {
                    return type.cast(this);
                }
                throw new ClassCastException("Cannot unwrap to " + type.getName());
            }
        }
    
        static class SelfRenewingCreds extends BaseCreds {
            @Override
            public CredentialsInternal renew() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/RegularContiguousSet.java

          return false;
        }
        try {
          @SuppressWarnings("unchecked") // The worst case is usually CCE, which we catch.
          C c = (C) object;
          return range.contains(c);
        } catch (ClassCastException e) {
          return false;
        }
      }
    
      @Override
      public boolean containsAll(Collection<?> targets) {
        return Collections2.containsAllImpl(this, targets);
      }
    
      @Override
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 8.3K bytes
    - Viewed (0)
  5. guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java

          count = 0;
          putIndex = 0;
          takeIndex = 0;
        } finally {
          monitor.leave();
        }
      }
    
      /**
       * @throws UnsupportedOperationException {@inheritDoc}
       * @throws ClassCastException {@inheritDoc}
       * @throws NullPointerException {@inheritDoc}
       * @throws IllegalArgumentException {@inheritDoc}
       */
      @CanIgnoreReturnValue
      @Override
      public int drainTo(Collection<? super E> c) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 22.4K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/ImmutableSortedSetTest.java

      }
    
      // In GWT, java.util.TreeSet throws ClassCastException when the comparator
      // throws it, unlike the JDK.  Therefore, we accept ClassCastException as a
      // valid result thrown by java.util.TreeSet#equals.
      private static void assertNotEqualLenient(TreeSet<?> unexpected, SortedSet<?> actual) {
        try {
          assertThat(actual).isNotEqualTo(unexpected);
        } catch (ClassCastException accepted) {
        }
      }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 46.7K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb/SmbPipeHandleImpl.java

        @Override
        public <T extends SmbPipeHandle> T unwrap(final Class<T> type) {
            if (type.isAssignableFrom(this.getClass())) {
                return (T) this;
            }
            throw new ClassCastException();
        }
    
        /**
         * {@inheritDoc}
         *
         * @see jcifs.SmbPipeHandle#getPipe()
         */
        @Override
        public SmbNamedPipe getPipe() {
            return this.pipe;
        }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/collect/SetViewTest.java

      }
    
      /**
       * A {@link Set} that throws {@link NullPointerException} and {@link ClassCastException} from
       * {@link #contains}.
       */
      private static final class SetContainsThrows extends AbstractSet<Void> {
        @Override
        public boolean contains(@Nullable Object o) {
          throw o == null ? new NullPointerException() : new ClassCastException();
        }
    
        @Override
        public int size() {
          return 0;
        }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 29.9K bytes
    - Viewed (0)
  9. src/test/java/jcifs/internal/dfs/DfsReferralDataImplTest.java

                DfsReferralDataImpl unwrapped = referralData.unwrap(DfsReferralDataImpl.class);
                assertSame(referralData, unwrapped);
            }
    
            @Test
            @DisplayName("Should throw ClassCastException for incompatible type")
            void testUnwrapToIncompatibleType() {
                // Create a mock class that extends DfsReferralData but is not compatible
                class IncompatibleReferralData implements DfsReferralData {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 30.6K bytes
    - Viewed (0)
  10. guava/src/com/google/common/collect/ComparisonChain.java

       * for raw {@code Comparable} types in Guava in general is tracked as <a
       * href="https://github.com/google/guava/issues/989">#989</a>.)
       *
       * @throws ClassCastException if the parameters are not mutually comparable
       */
      public abstract ComparisonChain compare(Comparable<?> left, Comparable<?> right);
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Mar 17 20:26:29 UTC 2025
    - 11.1K bytes
    - Viewed (0)
Back to top