You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (Modifier.isFinal(structField.field.getModifiers())) {
498
-
thrownewUnsupportedOperationException("Read-only (final) structure fields may only be updated from native memory (field '" + structField.name + "' within " + getClass() + ")");
499
+
intmodifiers = structField.field.getModifiers();
500
+
if (Modifier.isFinal(modifiers)) {
501
+
if (overrideFinal) {
502
+
// WARNING: setAccessible(true) on phoneME does *not* allow overwriting of
503
+
// a final field. It also ignores any changes made to the
504
+
// field's modifiers (temporarily removing the final flag
505
+
// on the field does not work).
506
+
thrownewUnsupportedOperationException("This VM does not support Structures with final fields (field '" + structField.name + "' within " + getClass() + ")");
507
+
}
508
+
thrownewUnsupportedOperationException("Attempt to write to read-only field '" + structField.name + "' within " + getClass());
499
509
}
500
510
thrownewError("Unexpectedly unable to write to field '"
Copy file name to clipboardexpand all lines: src/com/sun/jna/overview.html
+1-1
Original file line number
Diff line number
Diff line change
@@ -698,7 +698,7 @@ <h2>Library Global Data</h2>
698
698
<aname="crash-protection"></a>
699
699
<h2>VM Crash Protection</h2>
700
700
It is not uncommon when defining a new library and writing tests to encounter memory access errors which crash the VM. These are often caused by improper mappings or invalid arguments passed to the native library. To generate Java errors instead of crashing the VM, call {@link com.sun.jna.Native#setProtected Native.setProtected(true)}</code>. Not all platforms support this protection; if not, the value of {@link com.sun.jna.Native#isProtected} will remain <code>false</code>.<p>
701
-
NOTE: When protected mode is enabled, you should make use of the jsig library, if available (see <ahref="http://download.oracle.com/javase/6/docs/technotes/guides//vm/signal-chaining.htmld">Signal Chaining</a>) to avoid interfering with the JVM's use of signals. In short, set the environment variable <code>LD_PRELOAD</code> (or <code>LD_PRELOAD_64</code>) to the path to <code>libjsig.so</code> in your JRE lib directory (usually ${java.home}/lib/${os.arch}/libjsig.so) before launching your Java application.
701
+
NOTE: When protected mode is enabled, you should make use of the jsig library, if available (see <ahref="http://download.oracle.com/javase/6/docs/technotes/guides/vm/signal-chaining.html">Signal Chaining</a>) to avoid interfering with the JVM's use of signals. In short, set the environment variable <code>LD_PRELOAD</code> (or <code>LD_PRELOAD_64</code>) to the path to <code>libjsig.so</code> in your JRE lib directory (usually ${java.home}/lib/${os.arch}/libjsig.so) before launching your Java application.
0 commit comments