Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
3b3d1f6
Merge branch 'master' into rmv_th_loc_ign
nizhikov Sep 24, 2026
64fd3be
Merge branch 'master' into move1
nizhikov Sep 24, 2026
31f2763
WIP
nizhikov Sep 24, 2026
3e7a4d2
WIP
nizhikov Sep 24, 2026
a8a61bb
WIP
nizhikov Sep 25, 2026
1b752d2
Merge branch 'master' into move1
nizhikov Sep 25, 2026
48da14f
WIP
nizhikov Sep 25, 2026
085e6b8
WIP
nizhikov Sep 28, 2026
d8a2193
WIP
nizhikov Sep 28, 2026
c6d28cf
WIP
nizhikov Sep 28, 2026
668f9a5
WIP
nizhikov Sep 28, 2026
0e793ae
WIP
nizhikov Sep 28, 2026
00dfa8d
IGNITE-28207 Remove preWrite, postWrite, postWriteHashCode, popSchema…
nizhikov Sep 28, 2026
f49834f
IGNITE-28207 Remove writePlainObject from BinaryWriterEx
nizhikov Sep 28, 2026
79a9293
IGNITE-28207 Remove writeBinaryObject from BinaryWriterEx
nizhikov Sep 28, 2026
5cc3a53
IGNITE-28207 Remove preWrite, postWrite, postWriteHashCode, popSchema…
nizhikov Sep 28, 2026
fa2c11f
IGNITE-28207 Remove preWrite, postWrite, postWriteHashCode, popSchema…
nizhikov Sep 28, 2026
1d8e9a9
IGNITE-28207 Remove preWrite, postWrite, postWriteHashCode, popSchema…
nizhikov Sep 28, 2026
f6ea008
IGNITE-28207 Remove preWrite, postWrite, postWriteHashCode, popSchema…
nizhikov Sep 28, 2026
d59fde2
IGNITE-28207 Remove preWrite, postWrite, postWriteHashCode, popSchema…
nizhikov Sep 28, 2026
4277450
Merge branch 'master' into move1
nizhikov Sep 29, 2026
b4e5c7c
Remove BinaryContext thread local to see what will fail.
nizhikov Sep 29, 2026
f1c61c1
Remove BinaryContext thread local to see what will fail.
nizhikov Sep 29, 2026
2f2f8a4
Remove BinaryContext thread local to see what will fail.
nizhikov Sep 29, 2026
0385434
Remove BinaryContext thread local to see what will fail.
nizhikov Sep 29, 2026
93c2e37
Remove BinaryContext thread local to see what will fail.
nizhikov Sep 29, 2026
4015d2c
Remove BinaryContext thread local to see what will fail.
nizhikov Sep 29, 2026
9b91f33
Move read methods into implementaion.
nizhikov Sep 29, 2026
cfb0231
Move read methods into implementaion.
nizhikov Sep 30, 2026
608ca72
Merge branch 'master' into move4
nizhikov Oct 1, 2026
6a4da90
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 1, 2026
17e7618
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 1, 2026
a3e44c0
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 2, 2026
38a84af
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 2, 2026
9d793bc
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 2, 2026
d02dc50
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 2, 2026
3a5b104
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 2, 2026
d3eb27a
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 4, 2026
18e175b
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 5, 2026
52b2c62
IGNITE-29094 Remove useless byte array creation
nizhikov Oct 5, 2026
969f704
[MINOR] Simplify binary ClassLoader logic
nizhikov Oct 5, 2026
f2b0ee8
Merge branch 'master' into move4
nizhikov Oct 5, 2026
7d55a28
[MINOR] Simplify binary ClassLoader logic
nizhikov Oct 5, 2026
54c0a6c
[MINOR] Simplify binary ClassLoader logic
nizhikov Oct 5, 2026
e13bca4
Merge branch 'master' into move4
nizhikov Oct 5, 2026
fe09126
Merge branch 'master' into move4
nizhikov Oct 5, 2026
012e694
[MINOR] Remove single usage of CacheObjectValueContext#classLoader be…
nizhikov Oct 5, 2026
6f518f4
[MINOR] Remove single usage of CacheObjectValueContext#classLoader be…
nizhikov Oct 5, 2026
f6348a6
[MINOR] Remove single usage of CacheObjectValueContext#classLoader be…
nizhikov Oct 6, 2026
08b7227
[MINOR] Remove single usage of CacheObjectValueContext#classLoader be…
nizhikov Oct 6, 2026
788ea97
[MINOR] Remove single usage of CacheObjectValueContext#classLoader be…
nizhikov Oct 6, 2026
b860470
[MINOR] Remove single usage of CacheObjectValueContext#classLoader be…
nizhikov Oct 6, 2026
ac4af70
Merge branch 'master' into move4
nizhikov Oct 6, 2026
1298a36
Merge branch 'master' into move4
nizhikov Oct 7, 2026
cc64971
Merge branch 'master' into move4
nizhikov Oct 9, 2026
4f85fce
Fixes
nizhikov Oct 9, 2026
b2f4f19
Merge branch 'master' into move4
nizhikov Oct 12, 2026
c304dfe
IGNITE-29117 Review fixes.
nizhikov Oct 12, 2026
1573a75
Merge branch 'master' into move4
nizhikov Oct 12, 2026
244ddd1
Merge branch 'master' into move4
nizhikov Oct 15, 2026
197111c
Merge branch 'master' into move4
nizhikov Oct 16, 2026
4887aa9
Rework reader helpers back to static methods, as in IGNITE-29156
nizhikov Oct 16, 2026
949d733
Merge branch 'master' into move4
nizhikov Oct 16, 2026
f09ed44
IGNITE-29156 Remove BinaryReaderHandlesHolder interface from ignite-b…
nizhikov Oct 17, 2026
50e5060
Merge branch 'master' into move4
nizhikov Oct 19, 2026
db0aab1
Merge branch 'master' into move4
nizhikov Oct 19, 2026
ea162cb
Merge branch 'master' into move4
nizhikov Oct 20, 2026
604c800
IGNITE-29156 Remove BinaryReaderHandlesHolder interface from ignite-b…
nizhikov Oct 20, 2026
0d85496
Merge branch 'master' into move4
nizhikov Oct 30, 2026
ebd8aef
IGNITE-29156 Remove BinaryReaderHandlesHolder interface from ignite-b…
nizhikov Oct 30, 2026
a11e441
IGNITE-29156 Remove BinaryReaderHandlesHolder interface from ignite-b…
nizhikov Oct 30, 2026
0ab3d45
IGNITE-29156 Remove BinaryReaderHandlesHolder interface from ignite-b…
nizhikov Oct 30, 2026
a04c723
IGNITE-29156 Remove BinaryReaderHandlesHolder interface from ignite-b…
nizhikov Nov 2, 2026
dc40756
Merge branch 'master' into move4
nizhikov Nov 6, 2026
540bc36
Merge branch 'master' into move4
nizhikov Nov 6, 2026
c106e64
[MINOR] Use instance variable instead of getter
nizhikov Nov 6, 2026
3aa3158
[MINOR] Use instance variable instead of getter
nizhikov Nov 6, 2026
d43ff82
[MINOR] Use instance variable instead of getter
nizhikov Nov 6, 2026
6d22d94
Move readObjectDetached change to separate ticket
nizhikov Nov 6, 2026
f4fa9d5
Merge branch 'master' into move4
nizhikov Nov 6, 2026
c352fa8
[MINOR] Use instance variable instead of getter
nizhikov Nov 6, 2026
5b7b8bc
Merge branch 'master' into move4
nizhikov Nov 9, 2026
230f6dc
move4
nizhikov Nov 9, 2026
25bda89
Merge branch 'master' into move4
nizhikov Nov 10, 2026
5275ad3
Merge fixes.
nizhikov Nov 10, 2026
0c5cc24
Merge fixes.
nizhikov Nov 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.sql.Time;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
Expand Down Expand Up @@ -79,6 +80,21 @@

/**
* Binary context.
*
* <h3>Class loaders</h3>
* Binary code deals with exactly two kinds of class loaders:
* <ul>
* <li><b>Default loader</b> - {@link #classLoader()}. It is the loader set via
* {@code IgniteConfiguration#getClassLoader()} or ({@link CommonUtils#gridClassLoader()}).
* Classes resolved through it are cached.</li>
*
* <li><b>Custom loader</b> - a deployment (peer class loading) or user supplied loader passed explicitly
* into a binary API call. Such loaders can be undeployed (see {@link #onUndeploy(ClassLoader)}),
* so classes resolved through them are never cached.</li>
* </ul>
* A {@code null} loader anywhere in the binary API means "use the default loader".
* Use {@link #resolveClassLoader(ClassLoader)} to turn a caller supplied loader into the one to actually use and
* {@link #isCustomLoader(ClassLoader)} to decide whether caching must be bypassed.
*/
public class BinaryContext {
/** */
Expand Down Expand Up @@ -122,8 +138,8 @@ public class BinaryContext {
/** Node name. */
private final @Nullable String igniteInstanceName;

/** Class loader. */
private final @Nullable ClassLoader clsLdr;
/** Default class loader. Configured loader or the loader Ignite was loaded by. Never {@code null}. */
private final ClassLoader clsLdr;

/** Actual marshaller. */
private final BinaryMarshaller marsh;
Expand Down Expand Up @@ -156,7 +172,7 @@ public class BinaryContext {
* @param metaHnd Meta data handler.
* @param marsh Binary marshaller.
* @param igniteInstanceName Ignite instance name.
* @param clsLdr Class loader.
* @param clsLdr Configured class loader or {@code null} to use the loader Ignite was loaded by.
* @param dfltSerializer Binary serializer.
* @param idMapper Binary id mapper.
* @param nameMapper Binary name mapper.
Expand Down Expand Up @@ -185,7 +201,7 @@ public BinaryContext(

this.metaHnd = metaHnd;
this.igniteInstanceName = igniteInstanceName;
this.clsLdr = clsLdr;
this.clsLdr = clsLdr != null ? clsLdr : CommonUtils.gridClassLoader();
this.dfltSerializer = dfltSerializer;

if (idMapper != null || nameMapper != null || !F.isEmpty(typeCfgs))
Expand Down Expand Up @@ -325,20 +341,38 @@ public String igniteInstanceName() {
}

/**
* @return Class loader.
* @return Default class loader. Configured loader or the loader Ignite was loaded by. Never {@code null}.
*/
public ClassLoader classLoader() {
return clsLdr;
}

/**
* @param ldr Caller supplied class loader or {@code null}.
* @return {@code ldr} if it is a custom loader, default loader otherwise.
* @see #isCustomLoader(ClassLoader)
*/
public ClassLoader resolveClassLoader(@Nullable ClassLoader ldr) {
return isCustomLoader(ldr) ? ldr : clsLdr;
}

/**
* @param ldr Caller supplied class loader or {@code null}.
* @return {@code True} if {@code ldr} is a custom (deployment or user supplied) loader,
* {@code false} if it is {@code null}, the default loader or the loader Ignite was loaded by.
*/
public boolean isCustomLoader(@Nullable ClassLoader ldr) {
return ldr != null && ldr != clsLdr && ldr != CommonUtils.gridClassLoader();
}

/**
* @param clsName Class name.
* @return Class loaded by the configured class loader or {@code null} if it is not available to it.
* @see org.apache.ignite.configuration.IgniteConfiguration#getClassLoader()
*/
@Nullable private Class<?> loadClassOrNull(String clsName) {
try {
return CommonUtils.resolveClassLoader(null, clsLdr).loadClass(clsName);
return clsLdr.loadClass(clsName);
}
catch (ClassNotFoundException | NoClassDefFoundError ignored) {
return null;
Expand Down Expand Up @@ -473,20 +507,24 @@ public static BinaryNameMapper defaultNameMapper() {
}

/**
* Lists classes of the package visible on the classpath of {@link #classLoader()}.
* When a custom loader is configured, the classpath Ignite itself was loaded from is scanned as well.
*
* @param pkgName Package name.
* @return Class names.
*/
@SuppressWarnings("ConstantConditions")
private static Iterable<String> classesInPackage(String pkgName) {
private Iterable<String> classesInPackage(String pkgName) {
assert pkgName != null;

Collection<String> clsNames = new ArrayList<>();

ClassLoader ldr = CommonUtils.gridClassLoader();

String pkgPath = pkgName.replaceAll("\\.", "/");

URL[] urls = CommonUtils.classLoaderUrls(ldr);
Collection<URL> urls = new LinkedHashSet<>(Arrays.asList(CommonUtils.classLoaderUrls(clsLdr)));

if (clsLdr != CommonUtils.gridClassLoader())
urls.addAll(Arrays.asList(CommonUtils.classLoaderUrls(CommonUtils.gridClassLoader())));

for (URL url : urls) {
String proto = url.getProtocol().toLowerCase();
Expand Down Expand Up @@ -717,14 +755,14 @@ private BinaryClassDescriptor systemClassDescriptor(Class<?> cls, String clsName
/**
* @param userType User type or not.
* @param typeId Type ID.
* @param ldr Class loader or {@code null} to use {@link CommonUtils#gridClassLoader()}.
* @param ldr Custom class loader or {@code null} to use {@link #classLoader()}.
* @param registerMeta If {@code true}, then metadata will be registered along with the type descriptor.
* @return Class descriptor.
*/
BinaryClassDescriptor descriptorForTypeId(
boolean userType,
int typeId,
ClassLoader ldr,
@Nullable ClassLoader ldr,
boolean registerMeta
) {
assert typeId != GridBinaryMarshaller.UNREGISTERED_TYPE_ID;
Expand All @@ -735,6 +773,8 @@ BinaryClassDescriptor descriptorForTypeId(
if (desc != null)
return desc;

ldr = resolveClassLoader(ldr);

Class cls;

try {
Expand All @@ -760,20 +800,14 @@ BinaryClassDescriptor descriptorForTypeId(
}
catch (ClassNotFoundException e) {
// Class might have been loaded by default class loader.
if (userType
&& ldr != null
&& !ldr.equals(CommonUtils.gridClassLoader())
&& (desc = descriptorForTypeId(true, typeId, null, registerMeta)) != null)
if (userType && isCustomLoader(ldr) && (desc = descriptorForTypeId(true, typeId, null, registerMeta)) != null)
return desc;

throw new BinaryInvalidTypeException(e);
}
catch (IgniteCheckedException e) {
// Class might have been loaded by default class loader.
if (userType
&& ldr != null
&& !ldr.equals(CommonUtils.gridClassLoader())
&& (desc = descriptorForTypeId(true, typeId, null, registerMeta)) != null)
if (userType && isCustomLoader(ldr) && (desc = descriptorForTypeId(true, typeId, null, registerMeta)) != null)
return desc;

throw new BinaryObjectException("Failed resolve class for ID: " + typeId, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
/**
* Utility class to deal with class loading.
* Contains internal class cache.
* <p>
* A {@code null} class loader passed to any method of this class means the loader Ignite itself was loaded by,
* {@link CommonUtils#gridClassLoader()}. This fallback serves {@link org.apache.ignite.marshaller.Marshaller} API
* callers and deployment code.
* Binary code resolves loaders through {@code BinaryContext#resolveClassLoader(ClassLoader)} and never passes
* {@code null} here.
*/
public class ClassLoaderUtils {
/** Primitive class map. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public BinaryArray(BinaryContext ctx, int compTypeId, @Nullable String compClsNa

/** {@inheritDoc} */
@Override public <T> T deserialize(ClassLoader ldr) throws BinaryObjectException {
if (ldr != null)
if (ctx.isCustomLoader(ldr))
Marshallers.USE_CACHE.set(Boolean.FALSE);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,15 @@ public BinaryEnumObjectImpl(BinaryContext ctx, byte[] arr) {

/** {@inheritDoc} */
@Override public <T> T deserialize(@Nullable ClassLoader ldr) throws BinaryObjectException {
if (ldr != null)
boolean customLdr = ctx.isCustomLoader(ldr);

if (customLdr)
Marshallers.USE_CACHE.set(Boolean.FALSE);

try {
Class cls = BinaryImplUtils.resolveClass(ctx, typeId, clsName, ldr, false);

return (T)(ldr == null ? BinaryEnumCache.get(cls, ord) : uncachedValue(cls));
return (T)(customLdr ? uncachedValue(cls) : BinaryEnumCache.get(cls, ord));
}
finally {
Marshallers.USE_CACHE.set(Boolean.TRUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
package org.apache.ignite.internal.binary;

import java.io.ByteArrayInputStream;

import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.binary.BinaryInvalidTypeException;
import org.apache.ignite.binary.BinaryObjectException;
import org.apache.ignite.internal.binary.streams.BinaryInputStream;
import org.apache.ignite.internal.marshaller.ClassLoaderUtils;
import org.apache.ignite.internal.util.CommonUtils;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.lang.IgniteBiTuple;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -370,7 +368,7 @@ public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @N
ByteArrayInputStream input = new ByteArrayInputStream(in.array(), in.position(), len);

try {
return ctx.optimizedMarsh().unmarshal(input, CommonUtils.resolveClassLoader(clsLdr, ctx.classLoader()));
return ctx.optimizedMarsh().unmarshal(input, ctx.resolveClassLoader(clsLdr));
}
catch (IgniteCheckedException e) {
throw new BinaryObjectException("Failed to unmarshal object with optimized marshaller", e);
Expand All @@ -394,8 +392,7 @@ static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String clsNam
@Nullable ClassLoader ldr, boolean registerMeta) {
Class cls;

if (ldr == null)
ldr = ctx.classLoader();
ldr = ctx.resolveClassLoader(ldr);

if (typeId != GridBinaryMarshaller.UNREGISTERED_TYPE_ID)
cls = ctx.descriptorForTypeId(true, typeId, ldr, registerMeta).describedClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ else if (fieldOffsetLen == BinaryImplUtils.OFFSET_2)

/** {@inheritDoc} */
@Nullable @Override public <T> T deserialize(@Nullable ClassLoader ldr) throws BinaryObjectException {
if (ldr == null)
if (!ctx.isCustomLoader(ldr))
return deserialize();

Marshallers.USE_CACHE.set(Boolean.FALSE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ else if (fieldOffLen == BinaryImplUtils.OFFSET_2)

/** {@inheritDoc} */
@Nullable @Override public <T> T deserialize(@Nullable ClassLoader ldr) throws BinaryObjectException {
if (ldr == null)
if (!ctx.isCustomLoader(ldr))
return deserialize();

Marshallers.USE_CACHE.set(Boolean.FALSE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ public final class BinaryReaderExImpl extends BinaryReaderHandlesHolder implemen
/** Input stream. */
private final BinaryInputStream in;

/** Class loader. */
/**
* Class loader to resolve classes with: custom loader or {@link BinaryContext#classLoader()}, resolved once here.
* {@code null} only when {@link #ctx} is {@code null}; such readers can read primitives only.
*/
private final ClassLoader ldr;

/** */
Expand Down Expand Up @@ -204,14 +207,14 @@ public BinaryReaderExImpl(BinaryContext ctx,
*
* @param ctx Context.
* @param in Input stream.
* @param ldr Class loader.
* @param ldr Custom class loader or {@code null} to use {@link BinaryContext#classLoader()}.
* @param hnds Reader handles or {@code null} to start a new handles context.
* @param skipHdrCheck Whether to skip header check.
* @param forUnmarshal {@code True} if reader is need to unmarshal object.
*/
public BinaryReaderExImpl(BinaryContext ctx,
BinaryInputStream in,
ClassLoader ldr,
@Nullable ClassLoader ldr,
@Nullable BinaryReaderHandles hnds,
boolean skipHdrCheck,
boolean forUnmarshal) {
Expand All @@ -220,7 +223,7 @@ public BinaryReaderExImpl(BinaryContext ctx,

this.ctx = ctx;
this.in = in;
this.ldr = ldr;
this.ldr = ctx == null ? ldr : ctx.resolveClassLoader(ldr);

start = in.position();

Expand Down Expand Up @@ -3278,7 +3281,7 @@ private static Object doReadProxy(BinaryInputStream in, BinaryContext ctx, Class

InvocationHandler ih = (InvocationHandler)doReadObject(in, ctx, ldr, handles);

return Proxy.newProxyInstance(ldr != null ? ldr : CommonUtils.gridClassLoader(), intfs, ih);
return Proxy.newProxyInstance(ldr, intfs, ih);
}

/**
Expand Down Expand Up @@ -3381,9 +3384,9 @@ private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContex
* @return Unmarshalled value.
* @throws BinaryObjectException In case of error.
*/
@Nullable static Object unmarshal(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr)
@Nullable static Object unmarshal(BinaryInputStream in, BinaryContext ctx, @Nullable ClassLoader ldr)
throws BinaryObjectException {
return unmarshal(in, ctx, ldr, new BinaryReaderHandlesHolder(null));
return unmarshal(in, ctx, ctx.resolveClassLoader(ldr), new BinaryReaderHandlesHolder(null), false, false);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ public Object getValueQuickly(int pos, int len) {
case GridBinaryMarshaller.OPTM_MARSH: {
final BinaryInputStream bin = BinaryStreams.inputStream(arr, pos + 1);

final Object obj = BinaryImplUtils.doReadOptimized(bin, ctx, ctx.classLoader());
final Object obj = BinaryImplUtils.doReadOptimized(bin, ctx, null);

return obj;
}
Expand Down Expand Up @@ -843,7 +843,7 @@ else if (flag == GridBinaryMarshaller.DECIMAL) {
case GridBinaryMarshaller.OPTM_MARSH: {
final BinaryInputStream bin = BinaryStreams.inputStream(arr, pos);

final Object obj = BinaryImplUtils.doReadOptimized(bin, ctx, ctx.classLoader());
final Object obj = BinaryImplUtils.doReadOptimized(bin, ctx, null);

pos = bin.position();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import java.util.concurrent.ConcurrentMap;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.marshaller.ClassLoaderUtils;
import org.apache.ignite.internal.util.CommonUtils;
import org.apache.ignite.internal.util.GridUnsafe;
import org.apache.ignite.internal.util.io.GridDataInput;
import org.apache.ignite.internal.util.typedef.internal.SB;
Expand Down Expand Up @@ -330,7 +329,7 @@ private Object readObject0() throws ClassNotFoundException, IOException {

InvocationHandler ih = (InvocationHandler)readObject();

return Proxy.newProxyInstance(clsLdr != null ? clsLdr : CommonUtils.gridClassLoader(), intfs, ih);
return Proxy.newProxyInstance(clsLdr, intfs, ih);

case ENUM:
case EXTERNALIZABLE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ else if (!(objFilter instanceof IgniteObjectInputFilter)) {
@Override protected <T> T unmarshal0(InputStream in, @Nullable ClassLoader clsLdr) throws IgniteCheckedException {
assert in != null;

if (clsLdr == null)
clsLdr = getClass().getClassLoader();

try (ObjectInputStream objIn = new JdkMarshallerObjectInputStream(new JdkMarshallerInputStreamWrapper(in), clsLdr)) {
return (T)objIn.readObject();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
import org.apache.ignite.internal.marshaller.ClassLoaderUtils;
import org.jetbrains.annotations.Nullable;

/**
* This class defines custom JDK object input stream.
*/
class JdkMarshallerObjectInputStream extends ObjectInputStream {
/** */
private final ClassLoader clsLdr;
private final @Nullable ClassLoader clsLdr;

/**
* @param in Parent input stream.
Expand All @@ -38,8 +39,6 @@ class JdkMarshallerObjectInputStream extends ObjectInputStream {
JdkMarshallerObjectInputStream(InputStream in, ClassLoader clsLdr) throws IOException {
super(in);

assert clsLdr != null;

this.clsLdr = clsLdr;

enableResolveObject(true);
Expand Down
Loading
Loading