I m mantaining some application and I have a categorymark as Serializable
, but Iire that is not being seriesized where the Serializable
.
确保这一点的最佳途径是什么? 能否静态地确定这一点?
增 编
I m mantaining some application and I have a categorymark as Serializable
, but Iire that is not being seriesized where the Serializable
.
确保这一点的最佳途径是什么? 能否静态地确定这一点?
增 编
不是直接的。 一般来说,在标语被写到<代码>时,就会出现序列化。 ObjectOutputStream,但这种情况最经常发生在你的法典之外(例如,在你使用的图书馆或你的集装箱内)。 因此,你有两个选择:
动态地界定了这一方法。 因此,你将最终知道该类别是否正在序列化,没有中断任何功能。 但是,你们需要运行这一系统:
private void writeObject(java.io.ObjectOutputStream out) {
out.defaultWriteObject();
log.info("Object of type " +
getClass().getName() + " is being serialized");
// optionally include a stacktrace here, or use a debugger, to see
// when exactly it happened
}
努力了解你们的客体。 如果它通过网络转移,或储存在临时储存(储存、藏匿),那么它就应当具有空中效力。 否则,很可能不是。
我认为,不可能静态地、至少非常困难地确定——你的物体可以是非基因收集的一部分,可以通过思考加以利用等等。
你们可以做的是,将一些伐木/造船编码放在“Resolve()”和“Replace(Replace)”方法的物体上,在物体的序列化/代号化时,这种方法由jvm指。
I m quite sure, that it can t be checked statically, except you don t use external libraries at all (which will not result in serious programs)
也许你正在使用像Hibernate这样的某种方式,在某些情况下需要具有序列性物体,或者你的物体必须通过网络服务或像Corba这样的其他中层设备站发送,因为这里的序列化是暗中进行的(在标有标识时)。
贵阶层的目的是什么?
Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...
Check this, List<String> list = new ArrayList<String>(); for (int i = 0; i < 10000; i++) { String value = (""+UUID.randomUUID().getLeastSignificantBits()).substring(3, ...
I am in the middle of solving a problem where I think it s best suited for a decorator and a state pattern. The high level setting is something like a sandwich maker and dispenser, where I have a set ...
I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I ...
I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...
If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...
I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....
I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...