File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
runtime/src/main/java/com4j Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -364,18 +364,20 @@ public int comEnumValue() {
364364 * definition. See https://docs.microsoft.com/en-gb/windows/desktop/api/oaidl/ns-oaidl-tagvariant
365365 */
366366 private static int variantSize () {
367- String model = System .getProperty ("sun.arch.data.model" );
368- if (model .equals ("64" )) {
367+ /* Typical os.arch values: `x86_64`, `amd64` */
368+ String model = System .getProperty ("os.arch" );
369+ if (model .indexOf ("64" ) != -1 ) {
369370 return 24 ;
370371 }
371372 return 16 ;
372373 }
373374
375+ private static final int variantSize = variantSize ();
376+
374377 /**
375378 * Creates an empty {@link Variant}.
376379 */
377380 public Variant () {
378- final int variantSize = variantSize ();
379381 image = ByteBuffer .allocateDirect (variantSize );
380382 image .order (ByteOrder .LITTLE_ENDIAN );
381383 // The initial content of a buffer is, in general, undefined. See the documentation of java.nio.Buffer.
You can’t perform that action at this time.
0 commit comments