- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for ClassCastException (0.61 sec)
-
src/test/java/jcifs/SmbTreeTest.java
*/ @Test void testUnwrap_throwsException() { when(smbTree.unwrap(any())).thenThrow(new ClassCastException("Cannot unwrap to specified type")); assertThrows(ClassCastException.class, () -> smbTree.unwrap(CustomSmbTree.class), "Should throw ClassCastException when type is incompatible"); } /** * Test for close() method under normal conditions.Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.2K bytes - Viewed (0) -
src/main/java/jcifs/DfsReferralData.java
* * @param <T> the target type to unwrap to * @param type the class of the target type * @return the referral adapted to type * @throws ClassCastException * if the type is not valid for this object */ <T extends DfsReferralData> T unwrap(Class<T> type); /** * Get the server this referral points to *Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 16 01:32:48 UTC 2025 - 2.5K bytes - Viewed (0) -
src/test/java/jcifs/dcerpc/msrpc/MsrpcShareGetInfoTest.java
infoField.setAccessible(true); infoField.set(msrpcShareGetInfo, info0); // This should throw ClassCastException assertThrows(ClassCastException.class, () -> { msrpcShareGetInfo.getSecurity(); }); } @Test void testGetSecurityWhenInfoIsNull() throws Exception {
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.3K bytes - Viewed (0) -
src/main/java/jcifs/internal/dfs/DfsReferralDataImpl.java
@Override public <T extends DfsReferralData> T unwrap(final Class<T> type) { if (type.isAssignableFrom(this.getClass())) { return (T) this; } throw new ClassCastException(); } @Override public long getExpiration() { return this.expiration; } @Override public int getPathConsumed() { return this.pathConsumed; }Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 16 01:32:48 UTC 2025 - 11.7K bytes - Viewed (0) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sun Aug 31 08:00:57 UTC 2025 - 10.2K bytes - Viewed (0) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 30.6K bytes - Viewed (0) -
src/main/java/jcifs/smb/SID.java
@SuppressWarnings("unchecked") @Override public <T> T unwrap(final Class<T> t) { if (t.isAssignableFrom(this.getClass())) { return (T) this; } throw new ClassCastException(); } /** * Gets the byte array representation of this SID. * * @return encoded SID */ public byte[] toByteArray() { return toByteArray(this); }Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 16 01:32:48 UTC 2025 - 16K bytes - Viewed (0) -
src/test/java/jcifs/SIDTest.java
SID sid = new SID(adminSidString); SID unwrapped = sid.unwrap(SID.class); assertNotNull(unwrapped); assertEquals(sid, unwrapped); assertThrows(ClassCastException.class, () -> sid.unwrap(String.class)); } /** * Test the resolve method. * * @throws IOException if an I/O error occurs */ @Test
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 13.5K bytes - Viewed (0) -
src/main/java/jcifs/smb/SmbTreeImpl.java
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sun Aug 31 08:00:57 UTC 2025 - 30K bytes - Viewed (0) -
src/main/java/jcifs/smb/SmbTransportImpl.java
@Override public <T extends SmbTransport> T unwrap(final Class<T> type) { if (type.isAssignableFrom(this.getClass())) { return (T) this; } throw new ClassCastException(); } /** * * @param tf * @return a session for the context */ @Override public SmbSessionImpl getSmbSession(final CIFSContext tf) {Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 30 05:58:03 UTC 2025 - 69.8K bytes - Viewed (0)