如何克隆 NotesDocument java 对象
我有以下Java代码,稍后尝试访问MISCDOC对象时,它似乎是无效的。我在NotesDocument上找不到.clone()方法。
if语句仅一次访问
Document MiscDoc = null;
wdoc = dcAll.getFirstDocument();
while (wdoc != null){
if(...){
MiscDoc = wdoc;
}
Document tmpdoc = dcAll.getNextDocument();
wdoc.recycle();
wdoc = tmpdoc;
}
一次
I have the following java code and when I try to access the MiscDoc object later it seem to be null. I could not find a .clone() method on NotesDocument.
the if statement is only accessed once
Document MiscDoc = null;
wdoc = dcAll.getFirstDocument();
while (wdoc != null){
if(...){
MiscDoc = wdoc;
}
Document tmpdoc = dcAll.getNextDocument();
wdoc.recycle();
wdoc = tmpdoc;
}
how can I resolve this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您回收时,每个文档在循环时,循环也会回收和循环后无效。
只是不要回收此某个文档,并且在循环时将可用。
最简单的方法是添加
break;
,如果您只是在寻找与(...)条件相匹配的第一个文档:As you recycle every document in while loop your MiscDoc is also recycled and null after loop.
Just don't recycle this certain document and it will be available after while loop.
Easiest way is to add
break;
if you are just looking for the first document that matches if(...) condition: