We’ve performed an analysis on Aspose.Words for Java 22.4 (both JDK1.6 and 1.7) for any potential incompatibilities with Oracle Java SE 11 or later (17). The following issues were identified based on Java bytecode scanning and reviewing the decompiled Java source code.
Summary
- Removed API in Java 11 - java.util.zip.CRC32: public void update(byte[]);
- Removed API in Java 11 - java.security.spec.ECGenParameterSpec: public java.lang.String getName();
- Unsupported Internal API - sun.security.provider.Sun
- Unsupported Internal API - sun.security.internal.spec.TlsPrfParameterSpec
- Unsupported Internal API - sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec
- Unsupported Internal API - sun.security.provider.SecureRandom
Analysis
Issue 1: Removed API in Java 11 - java.util.zip.CRC32: public void update(byte[]);
D:\Projects\Aspose\Aspose.Words for Java 22.4\decomp>grep -iR crc32 *
com/aspose/words/internal/zzGc.java:import java.util.zip.CRC32;
com/aspose/words/internal/zzGc.java: private CRC32 zzWkY;
com/aspose/words/internal/zzGc.java: this.zzWkY = new CRC32();
com/aspose/words/internal/zzIU.java:import java.util.zip.CRC32;
com/aspose/words/internal/zzIU.java: final CRC32 crc32;
com/aspose/words/internal/zzIU.java: (crc32 = new CRC32()).update(zzXVB.zzZ65());
com/aspose/words/internal/zzIU.java: zz9B.zzYX0((int)crc32.getValue());
com/aspose/words/internal/zzYZY.java:import java.util.zip.CRC32;
com/aspose/words/internal/zzYZY.java: final CRC32 crc32;
com/aspose/words/internal/zzYZY.java: (crc32 = new CRC32()).update(array);
com/aspose/words/internal/zzYZY.java: zipEntry.setCrc(crc32.getValue());
- zzGc.java --> ByteArrayOutputStream --> byte array
- zzIU.java --> zzXVB.zzZ65() --> byte[] zzZ65() --> byte array
- zzYZY.java --> final byte[] array --> byte array
Java 8 doc - https://docs.oracle.com/javase/8/docs/api/java/util/zip/CRC32.html
–> Java 8 introduced: void update(ByteBuffer buffer)
Java 11 doc - https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/zip/CRC32.html
–> Java 11 removed: void update(Byte[] b)
Issue 2: Removed API in Java 11 - java.security.spec.ECGenParameterSpec: public java.lang.String getName();
D:\Projects\Aspose\Aspose.Words for Java 22.4\decomp>grep -iR ECGenParameterSpec * | grep -i getName
com/aspose/words/internal/zzX0Q.java: String s = ecGenParameterSpec.getName();
com/aspose/words/internal/zzX0Q.java: throw new InvalidParameterSpecException("EC AlgorithmParameters cannot recognize curve " + ecGenParameterSpec.getName());
com/aspose/words/internal/zzX0Q.java: throw new InvalidAlgorithmParameterException("unknown curve ID: " + ((ECGenParameterSpec)params).getName());
com/aspose/words/internal/zzZ5q.java: this.zzNn = this.zzMq(((ECGenParameterSpec)params).getName());
com/aspose/words/internal/zzZfN.java: zzW8B = new zzW8B(new zzXEV(zzt7.zzmQ(((ECGenParameterSpec)params).getName())));
Java 8 doc - https://docs.oracle.com/javase/8/docs/api/java/security/spec/ECGenParameterSpec.html
Java 11 doc - https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/security/spec/ECGenParameterSpec.html
–> Methods declared in class java.security.spec.NamedParameterSpec
Issue 3: Unsupported Internal API - sun.security.provider.Sun
D:\Projects\Aspose\Aspose.Words for Java 22.4\decomp>grep -iR sun.security.provider.Sun *
com/aspose/words/internal/zz1S.java:import sun.security.provider.Sun;
Suggested replacement is java.security.Security.getProvider.
https://bugs.openjdk.java.net/browse/JDK-8062515
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8062515
“In general, you should avoid depending on a specific provider as it may not be available on other Java implementations. See Oracle security providers documentation for more rationale.”
Issue 4: Unsupported Internal API - sun.security.internal.spec.TlsPrfParameterSpec
D:\Projects\Aspose\Aspose.Words for Java 22.4\decomp>grep -R TlsPrfParameterSpec *
com/aspose/words/internal/zz1S.java: if (zzZI1("sun.security.internal.spec.TlsKeyMaterialParameterSpec") && zzZI1("sun.security.internal.spec.TlsKeyMaterialSpec") && zzZI1("sun.security.internal.spec.TlsMasterSecretParameterSpec") && zzZI1("sun.security.internal.spec.TlsPrfParameterSpec") && zzZI1("sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec")) {
com/aspose/words/internal/zzYwR.java:import sun.security.internal.spec.TlsPrfParameterSpec;
com/aspose/words/internal/zzYwR.java: private static TlsPrfParameterSpec zzXWJ(final SecretKey secretKey, final String s, final byte[] array, final int n, final String s2, final int n2, final int n3) {
com/aspose/words/internal/zzYwR.java: return (TlsPrfParameterSpec)zzYwR.zzZEW.newInstance(array2);
com/aspose/words/internal/zzYwR.java: throw new IllegalStateException("Unable to construct TlsPrfParameterSpec: " + ex.getMessage(), ex);
com/aspose/words/internal/zzYwR.java: return zz1S.class.getClassLoader().loadClass("sun.security.internal.spec.TlsPrfParameterSpec").getMethod("getPRFHashAlg", (Class<?>[])new Class[0]) != null;
com/aspose/words/internal/zzYwR.java: return zz1S.class.getClassLoader().loadClass("sun.security.internal.spec.TlsPrfParameterSpec").getConstructors()[0];
com/aspose/words/internal/zzYwR.java: protected static SecretKey zzXWJ(final TlsPrfParameterSpec tlsPrfParameterSpec, final String s) {
com/aspose/words/internal/zzYwR.java: TlsPrfParameterSpec tlsPrfParameterSpec;
com/aspose/words/internal/zzYwR.java: TlsPrfParameterSpec tlsPrfParameterSpec;
com/aspose/words/internal/zzYwR.java: TlsPrfParameterSpec tlsPrfParameterSpec;
com/aspose/words/internal/zzYwR.java: private TlsPrfParameterSpec zzXiC;
com/aspose/words/internal/zzYwR.java: zzWOu.this.zzXiC = (TlsPrfParameterSpec)algorithmParameterSpec;
The sun.security.internal.spec.TlsPrfParameterSpec is considered an Unsupported Internal API.
Issue 5: Unsupported Internal API - sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec
D:\Projects\Aspose\Aspose.Words for Java 22.4\decomp>grep -iR TlsRsaPremasterSecretParameterSpec *
com/aspose/words/internal/zz1S.java: if (zzZI1("sun.security.internal.spec.TlsKeyMaterialParameterSpec") && zzZI1("sun.security.internal.spec.TlsKeyMaterialSpec") && zzZI1("sun.security.internal.spec.TlsMasterSecretParameterSpec") && zzZI1("sun.security.internal.spec.TlsPrfParameterSpec") && zzZI1("sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec")) {
com/aspose/words/internal/zzYwR.java:import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec;
com/aspose/words/internal/zzYwR.java: return zz1S.class.getClassLoader().loadClass("sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec").getMethod("getEncodedSecret", (Class<?>[])new Class[0]) != null;
com/aspose/words/internal/zzYwR.java: private TlsRsaPremasterSecretParameterSpec zzZu8;
com/aspose/words/internal/zzYwR.java: zzqi.this.zzZu8 = (TlsRsaPremasterSecretParameterSpec)algorithmParameterSpec;
com/aspose/words/internal/zzYwR.java: if ((array = (byte[])zz1S.class.getClassLoader().loadClass("sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec").getMethod("getEncodedSecret", (Class<?>[])new Class[0]).invoke(zzqi.this.zzZu8, new Object[0])) == null) {
com/aspose/words/internal/zzYwR.java: throw new IllegalStateException("internal error, profile of TlsRSAPremasterSecretParameterSpec has changed: " + ex.getMessage(), ex);
The sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec is considered an Unsupported Internal API.
Issue 6: Unsupported Internal API - sun.security.provider.SecureRandom
D:\Projects\Aspose\Aspose.Words for Java 22.4\decomp>grep -iR 'sun.security.provider.SecureRandom' *
com/aspose/words/internal/zz1S.java: super(new sun.security.provider.SecureRandom(), zz2H());
The sun.security.provider.SecureRandom is considered an Unsupported Internal API.
Closing Comments
Kindly requesting for your review of these issues and implement the necessary code changes to Aspose.Words for Java code base to ensure compatibility with later Java releases.