Author: akazakov
Date: 2010-04-30 10:32:07 -0400 (Fri, 30 Apr 2010)
New Revision: 21830
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
Log:
Moved model releasing to finally block.
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2010-04-30
14:29:10 UTC (rev 21829)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2010-04-30
14:32:07 UTC (rev 21830)
@@ -79,10 +79,15 @@
if (document instanceof IStructuredDocument) {
IStructuredModel model = StructuredModelManager.getModelManager()
.getExistingModelForRead(document);
- if (model instanceof IDOMModel) {
- this.document = ((IDOMModel) model).getDocument();
+ try {
+ if (model instanceof IDOMModel) {
+ this.document = ((IDOMModel) model).getDocument();
+ }
+ } finally {
+ if(model!=null) {
+ model.releaseFromRead();
+ }
}
- model.releaseFromRead();
}
}
Show replies by date