问题描述
07-11 02:26:51.393 E/AndroidRuntime(11963): Process: com.youku.iot,PID: 11963
07-11 02:26:51.393 E/AndroidRuntime(11963): Process: com.youku.iot,PID: 11963
07-11 02:26:51.393 E/AndroidRuntime(11963): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference
07-11 02:26:51.393 E/AndroidRuntime(11963): at android.os.Parcel.createException(Parcel.java:1956)
07-11 02:26:51.393 E/AndroidRuntime(11963): at android.os.Parcel.readException(Parcel.java:1918)
07-11 02:26:51.393 E/AndroidRuntime(11963): at android.os.Parcel.readException(Parcel.java:1868)
07-11 02:26:51.393 E/AndroidRuntime(11963): at com.xiaomi.mi_soundBox_command_sdk.IMiCommandInterface$Stub$Proxy.setPlaying(IMiCommandInterface.java:150)
以下代码来自Android源代码,但找不到任何可调用的代码 Object.hashCode。
/**
* Throw an exception with the given message. Not intended for use
* outside the Parcel class.
*
* @param code Used to determine which exception class to throw.
* @param msg The exception message.
*/
public final void readException(int code,String msg) {
String remoteStackTrace = null;
final int remoteStackPayloadSize = readInt();
if (remoteStackPayloadSize > 0) {
remoteStackTrace = readString();
}
Exception e = createException(code,msg);
// Attach remote stack trace if availalble
if (remoteStackTrace != null) {
remoteexception cause = new remoteexception(
"Remote stack trace:\n" + remoteStackTrace,null,false,false);
try {
Throwable rootCause = ExceptionUtils.getRootCause(e);
if (rootCause != null) {
rootCause.initCause(cause);
}
} catch (RuntimeException ex) {
Log.e(TAG,"Cannot set cause " + cause + " for " + e,ex);
}
}
SneakyThrow.sneakyThrow(e);
}
/**
* Creates an exception with the given message.
*
* @param code Used to determine which exception class to throw.
* @param msg The exception message.
*/
private Exception createException(int code,String msg) {
switch (code) {
case EX_PARCELABLE:
if (readInt() > 0) {
return (Exception) readParcelable(Parcelable.class.getClassLoader());
} else {
return new RuntimeException(msg + " [missing Parcelable]");
}
case EX_Security:
return new SecurityException(msg);
case EX_BAD_PARCELABLE:
return new BadParcelableException(msg);
case EX_ILLEgal_ARGUMENT:
return new IllegalArgumentException(msg);
case EX_NULL_POINTER:
return new NullPointerException(msg);
case EX_ILLEgal_STATE:
return new IllegalStateException(msg);
case EX_NETWORK_MAIN_THREAD:
return new networkonmainthreadException();
case EX_UNSUPPORTED_OPERATION:
return new UnsupportedOperationException(msg);
case EX_SERVICE_SPECIFIC:
return new ServiceSpecificException(readInt(),msg);
}
return new RuntimeException("UnkNown exception code: " + code
+ " msg " + msg);
}
/**
* Read an integer value from the parcel at the current dataPosition().
*/
public final int readInt() {
return nativeReadInt(mNativePtr);
}
/**
* Read a long integer value from the parcel at the current dataPosition().
*/
public final long readLong() {
return nativeReadLong(mNativePtr);
}
问题:在上面的代码中找不到任何调用Object.hashCode的代码。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)