Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-57515] update JNA library from 4.5.2 to 5.3.1 #4060

Merged
merged 4 commits into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ THE SOFTWARE.
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.5.2</version>
<version>5.3.1</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</dependency>
<dependency>
<groupId>org.kohsuke</groupId>
Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/hudson/util/ProcessTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.sun.jna.Memory;
import com.sun.jna.Native;
import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.LastErrorException;
import com.sun.jna.ptr.IntByReference;
import hudson.EnvVars;
Expand Down Expand Up @@ -1442,7 +1441,7 @@ private SolarisProcess(int pid) throws IOException {
* Read the remainder of psinfo_t differently depending on whether the
* Java process is 32-bit or 64-bit.
*/
if (Pointer.SIZE == 8) {
Copy link
Member

@oleg-nenashev oleg-nenashev Jun 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a binary incompatible change in JNA?

UPD: No https://github.com/java-native-access/jna/blob/master/src/com/sun/jna/Pointer.java has no reference to SIZE anymore.

if (Native.POINTER_SIZE == 8) {
psinfo.seek(236); // offset of pr_argc
argc = adjust(psinfo.readInt());
argp = adjustL(psinfo.readLong());
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/util/jna/Kernel32Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static boolean isJunctionOrSymlink(File file) throws IOException {
public static File getTempDir() {
Memory buf = new Memory(1024);
if (Kernel32.INSTANCE.GetTempPathW(512,buf)!=0) {// the first arg is number of wchar
return new File(buf.getString(0, true));
return new File(buf.getWideString(0));
} else {
return null;
}
Expand Down