Skip to content

Commit 0d6aedd

Browse files
committed
Partially revert previous change to ExtenalizableHelper
(merge main -> ce/main 108330) [git-p4: depot-paths = "//dev/coherence-ce/main/": change = 108331]
1 parent 8f4cb94 commit 0d6aedd

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

prj/coherence-core/src/main/java/com/tangosol/util/ExternalizableHelper.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@
107107
import java.nio.BufferOverflowException;
108108
import java.nio.charset.StandardCharsets;
109109

110+
import java.security.AccessController;
111+
import java.security.PrivilegedAction;
112+
110113
import java.sql.Date;
111114
import java.sql.Time;
112115
import java.sql.Timestamp;
@@ -2683,9 +2686,9 @@ public static void writeExternalizableLite(DataOutput out, ExternalizableLite o)
26832686
{
26842687
try
26852688
{
2686-
type.serializer().newInstance().serialize(out, o);
2689+
type.serializer().getDeclaredConstructor().newInstance().serialize(out, o);
26872690
}
2688-
catch (InstantiationException | IllegalAccessException e)
2691+
catch (InstantiationException | InvocationTargetException| NoSuchMethodException | IllegalAccessException e)
26892692
{
26902693
throw new IOException(e);
26912694
}
@@ -7465,9 +7468,9 @@ else if (method.getName().equals("streamBytes"))
74657468

74667469
try
74677470
{
7468-
XmlDocument xml = new Callable<XmlDocument>()
7471+
XmlDocument xml = AccessController.doPrivileged(new PrivilegedAction<XmlDocument>()
74697472
{
7470-
public XmlDocument call()
7473+
public XmlDocument run()
74717474
{
74727475
String sConfig = Config.getProperty(PROPERTY_CONFIG);
74737476
XmlDocument xml = null;
@@ -7505,13 +7508,14 @@ public XmlDocument call()
75057508
XmlHelper.replaceSystemProperties(xml, "system-property");
75067509
return xml;
75077510
}
7508-
}.call();
7511+
});
7512+
75097513

75107514
final XmlElement xmlFactory = xml.getSafeElement("object-stream-factory");
75117515

7512-
factory = new Callable<ObjectStreamFactory>()
7516+
factory = AccessController.doPrivileged(new PrivilegedAction<ObjectStreamFactory>()
75137517
{
7514-
public ObjectStreamFactory call()
7518+
public ObjectStreamFactory run()
75157519
{
75167520
try
75177521
{
@@ -7528,7 +7532,7 @@ public ObjectStreamFactory call()
75287532
}
75297533
return new DefaultObjectStreamFactory();
75307534
}
7531-
}.call();
7535+
});
75327536

75337537
fResolve = xml.getSafeElement("force-classloader-resolving").getBoolean(fResolve);
75347538
fCache = xml.getSafeElement("enable-xmlbean-class-cache").getBoolean(fCache);

0 commit comments

Comments
 (0)