根據the thread about Strings and security in java,String
類型在用於密碼屬性時可能很危險,主要是因爲字符串是不可變的(可以在VM映像中找到)並且可以被記錄。Thrift:爲Java生成char數組
當我使用Thrift生成Java類時,是否有可以生成char []
(char數組)的節儉類型或選項,以便我可以避免直接操作生成的Java類?
根據the thread about Strings and security in java,String
類型在用於密碼屬性時可能很危險,主要是因爲字符串是不可變的(可以在VM映像中找到)並且可以被記錄。Thrift:爲Java生成char數組
當我使用Thrift生成Java類時,是否有可以生成char []
(char數組)的節儉類型或選項,以便我可以避免直接操作生成的Java類?
什麼thrift --help
說,這是針對Java:
java (Java):
beans: Members will be private, and setter methods will return void.
private-members: Members will be private, but setter methods will return 'this' like usual.
nocamel: Do not use CamelCase field accessors with beans.
fullcamel: Convert underscored_accessor_or_service_names to camelCase.
android: Generated structures are Parcelable.
android_legacy: Do not use java.io.IOException(throwable) (available for Android 2.3 and above).
option_type: Wrap optional fields in an Option type.
java5: Generate Java 1.5 compliant code (includes android_legacy flag).
reuse-objects: Data objects will not be allocated, but existing instances will be used (read and write).
sorted_containers:
Use TreeSet/TreeMap instead of HashSet/HashMap as a implementation of set/map.
因此,答案是:Currently not。
不是一個字符數組...但你可以用IDL親近這樣的:
namespace java array.test
struct Test {
1: list<byte> passwd;
2: binary passwd2;
}
list<byte>
將生成Java中的java.util.List<Byte>
場。
binary
將在Java中生成一個java.nio.ByteBuffer
字段。
我認爲你應該能夠有效地消除其中的任何一個,以實現你的鏈接問題中描述的內容。