Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 105 for ClassCastException (0.55 sec)

  1. guava-testlib/src/com/google/common/collect/testing/testers/CollectionContainsAllTester.java

        Collection<WrongType> wrong = MinimalCollection.of(WrongType.VALUE);
        try {
          assertFalse(
              "containsAll(wrongType) should return false or throw", collection.containsAll(wrong));
        } catch (ClassCastException tolerated) {
        }
      }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Nov 14 23:40:07 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/HeadersJvmTest.kt

          Headers
            .Builder()
            .addUnsafeNonAscii("header1", "valué1")
            .build()
        assertThat(headers.toString()).isEqualTo("header1: valué1\n")
      }
    
      // Fails on JS, ClassCastException: Illegal cast
      @Test fun ofMapThrowsOnNull() {
        assertFailsWith<NullPointerException> {
          (mapOf("User-Agent" to null) as Map<String, String>).toHeaders()
        }
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 14:51:25 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java

        expectUnchanged();
      }
    
      @MapFeature.Require(SUPPORTS_REMOVE)
      public void testRemove_wrongType() {
        try {
          assertNull(getMap().remove(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
    - 5.9K bytes
    - Viewed (0)
  4. android/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceEntryTester.java

      @CollectionSize.Require(absent = ZERO)
      public void testReplaceEntry_supportedPresent() {
        try {
          assertTrue(getMap().replace(k0(), v0(), v3()));
          expectReplacement(entry(k0(), v3()));
        } catch (ClassCastException tolerated) { // for ClassToInstanceMap
          expectUnchanged();
        }
      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      @CollectionSize.Require(absent = ZERO)
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Oct 31 14:51:04 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  5. android/guava-testlib/src/com/google/common/collect/testing/testers/MapGetOrDefaultTester.java

        try {
          assertEquals(
              "getOrDefault(wrongType, default) should return default or throw",
              v3(),
              getMap().getOrDefault(WrongType.VALUE, v3()));
        } catch (ClassCastException tolerated) {
        }
      }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Oct 31 14:51:04 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  6. guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveTester.java

      }
    
      @CollectionFeature.Require(SUPPORTS_REMOVE)
      public void testRemove_wrongType() {
        try {
          assertFalse(collection.remove(WrongType.VALUE));
        } catch (ClassCastException tolerated) {
        }
        expectUnchanged();
      }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue Feb 11 21:04:02 UTC 2025
    - 5.6K bytes
    - Viewed (0)
  7. guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceEntryTester.java

      @CollectionSize.Require(absent = ZERO)
      public void testReplaceEntry_supportedPresent() {
        try {
          assertTrue(getMap().replace(k0(), v0(), v3()));
          expectReplacement(entry(k0(), v3()));
        } catch (ClassCastException tolerated) { // for ClassToInstanceMap
          expectUnchanged();
        }
      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      @CollectionSize.Require(absent = ZERO)
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Nov 14 23:40:07 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  8. src/test/java/jcifs/smb/SIDTest.java

            void testUnwrap() throws Exception {
                SID sid = new SID("S-1-5-21-1");
                // Happy path
                assertSame(sid, sid.unwrap(SID.class));
                assertSame(sid, sid.unwrap(Object.class));
                // Invalid unwrap
                assertThrows(ClassCastException.class, () -> sid.unwrap(String.class));
            }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  9. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java

          // because some comparator might throw NPE (e.g. the natural ordering).
          return object != null && sortedDelegate.contains(object);
        } catch (ClassCastException e) {
          return false;
        }
      }
    
      @Override
      public boolean containsAll(Collection<?> targets) {
        for (Object target : targets) {
          if (target == null) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Aug 06 18:32:41 UTC 2025
    - 15.5K bytes
    - Viewed (0)
  10. src/test/java/jcifs/smb/SmbTransportImplTest.java

                        return type.cast(this);
                    }
                    throw new ClassCastException("Cannot unwrap to " + type.getName());
                }
    
                @Override
                public void close() {
                    // no-op for test
                }
            }
            assertThrows(ClassCastException.class, () -> transport.unwrap(OtherTransport.class));
        }
    
        @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 17.6K bytes
    - Viewed (0)
Back to top