私はRobolectricでいくつかのコードに取り組んでいますIntegerResourceLoader. 次のメソッドは、 0xFFFF0000などのRuntimeExceptionwhenをスローしています。rawValue
@Override
public Object convertRawValue( String rawValue ) {
try {
return Integer.parseInt( rawValue );
} catch ( NumberFormatException nfe ) {
throw new RuntimeException( rawValue + " is not an integer." );
}
}
Integer.decode(String)を使用してみましたが、文法が正しいように見えても NumberFormatException がスローされます。