我在Android 4中有以下代码:
import org.bouncycastle.jce.exception.ExtCertificateEncodingException;
....
public void method(){
try {
throw new ExtCertificateEncodingException();
} catch(ExtCertificateEncodingException e){
}
}
我编译并运行它。抛出异常,但没有抓到。这有点困惑我。但是,经过调查后发现e
类型com.android.bouncycastle.jce.exception.ExtCertificateEncodingException
(或类似内容)而不是bouncycastle.jce.exception.ExtCertificateEncodingException
。
而且,我完全不明白。我认为类加载器会产生一些我无法理解的魔法。毕竟,我导入:
org.bouncycastle.jce.exception.ExtCertificateEncodingException
。
import com.android.bouncycastle.jce.exception.ExtCertificateEncodingException
catch(Exception e)