Kaydet (Commit) 7078dbb9 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

jurt: simplify deprecated XTypeProvider.getImplementationId

Change-Id: I6fc237a3274f51b282804b9a08fc063694376780
üst 90b27c94
...@@ -74,9 +74,6 @@ public class FactoryHelper { ...@@ -74,9 +74,6 @@ public class FactoryHelper {
protected Constructor<?> _constructor; protected Constructor<?> _constructor;
protected String _implName; protected String _implName;
protected String _serviceName; protected String _serviceName;
// keeps the Id for XTypeProvider
protected static Object _mutex= new Object();
private static byte[] _implementationId;
protected Factory(Class<?> implClass, protected Factory(Class<?> implClass,
String serviceName, String serviceName,
...@@ -387,25 +384,7 @@ public class FactoryHelper { ...@@ -387,25 +384,7 @@ public class FactoryHelper {
//XTypeProvider //XTypeProvider
public byte[] getImplementationId() public byte[] getImplementationId()
{ {
synchronized (_mutex) return new byte[0];
{
if (_implementationId == null)
{
int hash = hashCode();
String sName= getClass().getName();
byte[] arName= sName.getBytes();
int nNameLength= arName.length;
_implementationId= new byte[ 4 + nNameLength];
_implementationId[0]= (byte)(hash & 0xff);
_implementationId[1]= (byte)((hash >>> 8) & 0xff);
_implementationId[2]= (byte)((hash >>> 16) & 0xff);
_implementationId[3]= (byte)((hash >>>24) & 0xff);
System.arraycopy(arName, 0, _implementationId, 4, nNameLength);
}
}
return _implementationId;
} }
//XTypeProvider //XTypeProvider
public com.sun.star.uno.Type[] getTypes() public com.sun.star.uno.Type[] getTypes()
......
...@@ -874,7 +874,7 @@ class ATypeProvider implements com.sun.star.lang.XTypeProvider ...@@ -874,7 +874,7 @@ class ATypeProvider implements com.sun.star.lang.XTypeProvider
public byte[] getImplementationId() public byte[] getImplementationId()
{ {
return new byte[]{1,2,3}; return new byte[0];
} }
public com.sun.star.uno.Type[] getTypes() public com.sun.star.uno.Type[] getTypes()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment