Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for defensively (0.05 sec)

  1. guava/src/com/google/common/collect/ImmutableEnumSet.java

        final EnumSet<E> delegate;
    
        EnumSerializedForm(EnumSet<E> delegate) {
          this.delegate = delegate;
        }
    
        Object readResolve() {
          // EJ2 #76: Write readObject() methods defensively.
          return new ImmutableEnumSet<E>(delegate.clone());
        }
    
        @GwtIncompatible @J2ktIncompatible private static final long serialVersionUID = 0;
      }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 4.5K bytes
    - Viewed (0)
  2. src/test/java/jcifs/internal/SmbBasicFileInfoTest.java

            Assertions.assertThrows(NullPointerException.class, () -> {
                // Intentionally dereference null to validate exception behavior
                // This checks that callers must handle null references defensively
                info.getSize();
            });
        }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SecurityBlobTest.java

        // Uses reflection to set internal array to null to exercise defensive branch in length()
        @Test
        @DisplayName("length(): handles internal null defensively")
        void length_handlesNullInternalArray() throws Exception {
            // Arrange
            SecurityBlob blob = new SecurityBlob(new byte[] { 1, 2, 3 });
    
            // Force internal field to null via reflection to exercise defensive branch
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.4K bytes
    - Viewed (0)
  4. src/test/java/jcifs/spnego/SpnegoTokenTest.java

            t.setMechanismToken(data);
            assertArrayEquals(data, t.getMechanismToken(), "mechanismToken should round-trip");
    
            // Document current behavior: no defensive copy (reference exposed)
            data[0] = 9;
            assertEquals(9, t.getMechanismToken()[0], "no defensive copy; reflects external mutation");
        }
    
        @Test
        @DisplayName("Setter and getter for mechanismListMIC work")
        void setGetMechanismListMIC() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.6K bytes
    - Viewed (0)
  5. src/test/java/jcifs/ntlmssp/av/AvPairTest.java

            // Modify the original raw array
            raw[0] = 0x05;
    
            // Ensure the AvPair's internal raw array is not affected (defensive copy not made)
            // This test assumes that the AvPair constructor does NOT make a defensive copy of the raw array.
            // If a defensive copy were made, this test would fail, and the behavior would be more robust.
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 3K bytes
    - Viewed (0)
  6. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/-HeadersCommon.kt

          it
        }
      }
    
    internal fun commonHeadersOf(vararg inputNamesAndValues: String): Headers {
      require(inputNamesAndValues.size % 2 == 0) { "Expected alternating header names and values" }
    
      // Make a defensive copy and clean it up.
      val namesAndValues: Array<String> = arrayOf(*inputNamesAndValues)
      for (i in namesAndValues.indices) {
        require(namesAndValues[i] != null) { "Headers cannot be null" }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon May 05 16:01:00 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  7. src/test/java/jcifs/ntlmssp/av/AvChannelBindingsTest.java

        }
    
        /**
         * Test that the constructor stores the reference to the input byte array.
         * Note: The implementation does not create a defensive copy.
         */
        @Test
        void testConstructorStoresReference() {
            byte[] originalHash = { 0x01, 0x02, 0x03 };
            AvChannelBindings avChannelBindings = new AvChannelBindings(originalHash);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 2.4K bytes
    - Viewed (0)
  8. src/test/java/jcifs/smb1/smb1/AllocInfoTest.java

            assertEquals(capacity, mockAllocInfo.getCapacity());
        }
    
        /**
         * Null pointer scenario – calls on a null reference should raise
         * {@link NullPointerException}. This test is defensive; in real code it
         * would likely be handled elsewhere.
         */
        @Test
        @DisplayName("calling getters on null reference throws NPE")
        void testNullReference() {
            AllocInfo nullRef = null;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 2.4K bytes
    - Viewed (0)
  9. src/test/java/jcifs/smb/SessionSetupHandlerTest.java

        }
    
        @Test
        @DisplayName("Invalid: resolving class by null name throws NPE")
        void testClassForNameWithNull() {
            // Intent: demonstrate defensive behavior with null when resolving this type by name
            assertThrows(NullPointerException.class, () -> Class.forName(null));
        }
    
        @Test
        @DisplayName("Happy path: class is loadable via fully qualified name")
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.3K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/lease/Smb2LeaseKeyTest.java

            Smb2LeaseKey key2 = new Smb2LeaseKey();
    
            assertNotEquals(key1, key2);
            assertFalse(Arrays.equals(key1.getKey(), key2.getKey()));
        }
    
        @Test
        @DisplayName("Should return defensive copy of key")
        void testDefensiveCopy() {
            byte[] originalBytes =
                    new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 };
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 21 00:16:17 UTC 2025
    - 6K bytes
    - Viewed (0)
Back to top