Skip to content

Commit

Permalink
Remove further deprecated methods
Browse files Browse the repository at this point in the history
- com.sun.jna.Platform#isAix
- com.sun.jna.platform.win32.Ole32#CoCreateGuid(GUID.ByReference pguid)
- com.sun.jna.platform.win32.Ole32#CLSIDFromString(WString lpsz, CLSID.ByReference pclsid)
  • Loading branch information
matthiasblaesing committed Jul 13, 2018
1 parent 5c346ce commit 6481112
Show file tree
Hide file tree
Showing 37 changed files with 16 additions and 49 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ pom-jna-platform.xml.asc
.idea
*.iml
/contrib/platform/${build.generated.sources.dir}/
/contrib/platform/${build}/
/contrib/platform/${build}/
/contrib/platform/nbproject/private/
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Breaking Changes
* the parameters of the methods `gethostname`, `sethostname`, `getdomainname`
and `setdomainname` in the interface `com.sun.jna.platform.unix.LibCAPI`
were changed from `(char[] name, int len)` to `(byte[] name, int len)`
* `com.sun.jna.Platform#isAix` was replaced by `com.sun.jna.Platform#isAIX`
* `com.sun.jna.platform.win32.Sspi.SecBufferDesc` was incompatibly changed to
match the correct native semantics. SecBufferDesc describing more than one
buffer were broken. For most usecases
Expand Down Expand Up @@ -110,6 +111,10 @@ Breaking Changes
consequence `com.sun.jna.platform.win32.Advapi32Util#getFileSecurity` was
changed similarly. The SID accessors `getSidString` and `getSID` were moved
from `ACEStructure` to `ACCESS_ACEStructure`.
* `com.sun.jna.platform.win32.Ole32#CoCreateGuid(GUID.ByReference pguid)` was replaced by
`com.sun.jna.platform.win32.Ole32#CoCreateGuid(GUID pguid)` and
`com.sun.jna.platform.win32.Ole32#CLSIDFromString(WString lpsz, CLSID.ByReference pclsid)` was replaced by
`com.sun.jna.platform.win32.Ole32#CLSIDFromString(String lpsz, CLSID.ByReference pclsid)`

Release 4.5.0
=============
Expand Down
8 changes: 4 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
</condition>
<property name="jna.version" value="${jna.major}.${jna.minor}.${jna.revision}${version.suffix}"/>
<!-- jnidispatch library release version -->
<property name="jni.major" value="5"/>
<property name="jni.minor" value="2"/>
<property name="jni.revision" value="1"/>
<property name="jni.major" value="6"/>
<property name="jni.minor" value="0"/>
<property name="jni.revision" value="0"/>
<property name="jni.build" value="0"/> <!--${build.number}-->
<property name="jni.version" value="${jni.major}.${jni.minor}.${jni.revision}"/>
<property name="jni.md5" value="74e8f8e397c43487738c5c1f1363498b"/>
<property name="jni.md5" value="147a998f0cbc89681a1ae6c0dd121629"/>
<property name="spec.title" value="Java Native Access (JNA)"/>
<property name="spec.vendor" value="${vendor}"/>
<property name="spec.version" value="${jna.major}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.WString;
import com.sun.jna.platform.win32.Guid.CLSID;
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.OaIdl.MEMBERID;
Expand Down Expand Up @@ -87,8 +86,7 @@ public class TypeLibUtil {
public TypeLibUtil(String clsidStr, int wVerMajor, int wVerMinor) {
CLSID.ByReference clsid = new CLSID.ByReference();
// get CLSID from string
HRESULT hr = Ole32.INSTANCE.CLSIDFromString(new WString(clsidStr),
clsid);
HRESULT hr = Ole32.INSTANCE.CLSIDFromString(clsidStr, clsid);
COMUtils.checkRC(hr);

// load typelib
Expand Down
10 changes: 0 additions & 10 deletions contrib/platform/src/com/sun/jna/platform/win32/Ole32.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.WString;
import com.sun.jna.platform.win32.Guid.CLSID;
import com.sun.jna.platform.win32.Guid.GUID;
import com.sun.jna.platform.win32.WinDef.DWORD;
Expand Down Expand Up @@ -56,13 +55,6 @@ public interface Ole32 extends StdCallLibrary {
*/
HRESULT CoCreateGuid(GUID pguid);

/**
* @deprecated use {@link #CoCreateGuid(Guid.GUID)}.
* @param pguid GUID reference
* @return result
*/
HRESULT CoCreateGuid(GUID.ByReference pguid);

/**
* Converts a globally unique identifier (GUID) into a string of printable
* characters.
Expand Down Expand Up @@ -228,8 +220,6 @@ HRESULT CoCreateInstance(GUID rclsid, Pointer pUnkOuter, int dwClsContext,
* REGDB_E_READREGDB The registry could not be opened for reading.
*/
HRESULT CLSIDFromString(String lpsz, CLSID.ByReference pclsid);
/** @deprecated use the String version */
HRESULT CLSIDFromString(WString lpsz, CLSID.ByReference pclsid);

/**
* Allocates a block of task memory in the same way that IMalloc::Alloc does. CoTaskMemAlloc uses the default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.sun.jna.platform.win32.Ole32;
import com.sun.jna.platform.win32.OleAuto;
import com.sun.jna.platform.win32.WTypes;
import com.sun.jna.platform.win32.WTypes.BSTR;
import com.sun.jna.platform.win32.WinDef;
import com.sun.jna.platform.win32.WinDef.LCID;
import com.sun.jna.platform.win32.WinDef.UINT;
Expand Down Expand Up @@ -59,7 +58,7 @@ public ITypeLibTest() {
private ITypeLib loadShellTypeLib() {
CLSID.ByReference clsid = new CLSID.ByReference();
// get CLSID from string
HRESULT hr = Ole32.INSTANCE.CLSIDFromString(new WString(SHELL_CLSID), clsid);
HRESULT hr = Ole32.INSTANCE.CLSIDFromString(SHELL_CLSID, clsid);
assertTrue(COMUtils.SUCCEEDED(hr));

// get user default lcid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import junit.framework.TestCase;

import com.sun.jna.WString;
import com.sun.jna.platform.win32.Guid.CLSID;
import com.sun.jna.platform.win32.WTypes.BSTR;
import com.sun.jna.platform.win32.WinDef.LCID;
Expand Down Expand Up @@ -50,8 +49,8 @@ public void testSysFreeString() {
public void testLoadRegTypeLib() {
CLSID.ByReference clsid = new CLSID.ByReference();
// get CLSID from string, Microsoft Scripting Engine
HRESULT hr = Ole32.INSTANCE.CLSIDFromString(new WString(
"{420B2830-E718-11CF-893D-00A0C9054228}"), clsid);
HRESULT hr = Ole32.INSTANCE.CLSIDFromString(
"{420B2830-E718-11CF-893D-00A0C9054228}", clsid);
COMUtils.checkRC(hr);
assertEquals(0, hr.intValue());

Expand Down
Binary file modified lib/native/android-aarch64.jar
Binary file not shown.
Binary file modified lib/native/android-arm.jar
Binary file not shown.
Binary file modified lib/native/android-armv7.jar
Binary file not shown.
Binary file modified lib/native/android-mips.jar
Binary file not shown.
Binary file modified lib/native/android-mips64.jar
Binary file not shown.
Binary file modified lib/native/android-x86-64.jar
Binary file not shown.
Binary file modified lib/native/android-x86.jar
Binary file not shown.
Binary file modified lib/native/darwin.jar
Binary file not shown.
Binary file modified lib/native/freebsd-x86-64.jar
Binary file not shown.
Binary file modified lib/native/freebsd-x86.jar
Binary file not shown.
Binary file modified lib/native/linux-aarch64.jar
Binary file not shown.
Binary file modified lib/native/linux-arm.jar
Binary file not shown.
Binary file modified lib/native/linux-armel.jar
Binary file not shown.
Binary file modified lib/native/linux-mips64el.jar
Binary file not shown.
Binary file modified lib/native/linux-ppc.jar
Binary file not shown.
Binary file modified lib/native/linux-ppc64le.jar
Binary file not shown.
Binary file modified lib/native/linux-s390x.jar
Binary file not shown.
Binary file modified lib/native/linux-x86.jar
Binary file not shown.
Binary file modified lib/native/openbsd-x86-64.jar
Binary file not shown.
Binary file modified lib/native/openbsd-x86.jar
Binary file not shown.
Binary file modified lib/native/sunos-sparc.jar
Binary file not shown.
Binary file modified lib/native/sunos-sparcv9.jar
Binary file not shown.
Binary file modified lib/native/sunos-x86-64.jar
Binary file not shown.
Binary file modified lib/native/sunos-x86.jar
Binary file not shown.
Binary file modified lib/native/win32-x86-64.jar
Binary file not shown.
Binary file modified lib/native/win32-x86.jar
Binary file not shown.
15 changes: 0 additions & 15 deletions native/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2522,21 +2522,6 @@ JNIEXPORT jlong JNICALL Java_com_sun_jna_Native__1getPointer
return A2L(ptr);
}

/*
* Class: com_sun_jna_Native
* Method: getDirectByteBuffer
* Signature: (JJ)Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_com_sun_jna_Native_getDirectByteBuffer__JJ
(JNIEnv *env, jclass UNUSED(cls), jlong addr, jlong length)
{
#ifdef NO_NIO_BUFFERS
return NULL;
#else
return (*env)->NewDirectByteBuffer(env, L2A(addr), length);
#endif
}

/*
* Class: com_sun_jna_Native
* Method: getDirectByteBuffer
Expand Down
6 changes: 0 additions & 6 deletions src/com/sun/jna/Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -2260,12 +2260,6 @@ static String getString(Pointer pointer, long offset, String encoding) {
*/
public static native void free(long ptr);

/**
* @deprecated retained to keep native signature
*/
@Deprecated
private static native ByteBuffer getDirectByteBuffer(long addr, long length);

private static final ThreadLocal<Memory> nativeThreadTerminationFlag =
new ThreadLocal<Memory>() {
@Override
Expand Down
4 changes: 0 additions & 4 deletions src/com/sun/jna/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ public static final boolean isLinux() {
public static final boolean isAIX() {
return osType == AIX;
}
/** @deprecated */
public static final boolean isAix() {
return isAIX();
}
public static final boolean isWindowsCE() {
return osType == WINDOWSCE;
}
Expand Down
2 changes: 1 addition & 1 deletion src/com/sun/jna/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
package com.sun.jna;
interface Version {
String VERSION = "5.0.0-SNAPSHOT";
String VERSION_NATIVE = "5.2.1";
String VERSION_NATIVE = "6.0.0";
}

0 comments on commit 6481112

Please sign in to comment.