- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 19 for defensively (0.06 sec)
-
android/guava/src/com/google/common/hash/HashCode.java
return hash == that.asLong(); } private static final long serialVersionUID = 0; } /** * Creates a {@code HashCode} from a byte array. The array is defensively copied to preserve the * immutability contract of {@code HashCode}. The array cannot be empty. * * @since 15.0 (since 12.0 in HashCodes) */ public static HashCode fromBytes(byte[] bytes) {
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Mon Aug 11 19:31:30 UTC 2025 - 12.6K bytes - Viewed (0) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
src/test/java/jcifs/smb/PreauthIntegrityTest.java
// Verify the reset method exists assertNotNull(resetMethod); } } /** * Test that getPreauthIntegrityHash returns a defensive copy */ @Test @DisplayName("getPreauthIntegrityHash should return defensive copy") void testGetPreauthHashDefensiveCopy() throws Exception { byte[] hash = transport.getPreauthIntegrityHash(); assertNotNull(hash);
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Sat Aug 30 05:58:03 UTC 2025 - 10.5K bytes - Viewed (0) -
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)