Author: scabanovich
Date: 2007-07-20 10:49:42 -0400 (Fri, 20 Jul 2007)
New Revision: 2553
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/StrutsEntityRecognizer.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorRecognizer.java
Log:
EXIN-86 NullPointerException prevented when registering missing resources.
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/StrutsEntityRecognizer.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/StrutsEntityRecognizer.java 2007-07-20
14:15:20 UTC (rev 2552)
+++
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/StrutsEntityRecognizer.java 2007-07-20
14:49:42 UTC (rev 2553)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.struts.model;
-import org.eclipse.core.runtime.FileLocator;
import org.jboss.tools.common.xml.XMLEntityResolver;
import org.jboss.tools.struts.*;
import org.jboss.tools.common.model.loaders.*;
@@ -19,10 +18,10 @@
static {
try {
- Class c = StrutsEntityRecognizer.class;
- XMLEntityResolver.registerPublicEntity(DOC_PUBLICID_10,
FileLocator.resolve(c.getResource("/meta/struts-config_1_0.dtd")).toString());
- XMLEntityResolver.registerPublicEntity(DOC_PUBLICID_11,
FileLocator.resolve(c.getResource("/meta/struts-config_1_1.dtd")).toString());
- XMLEntityResolver.registerPublicEntity(DOC_PUBLICID_12,
FileLocator.resolve(c.getResource("/meta/struts-config_1_2.dtd")).toString());
+ Class<?> c = StrutsEntityRecognizer.class;
+ XMLEntityResolver.registerPublicEntity(DOC_PUBLICID_10, c,
"/meta/struts-config_1_0.dtd");
+ XMLEntityResolver.registerPublicEntity(DOC_PUBLICID_11, c,
"/meta/struts-config_1_1.dtd");
+ XMLEntityResolver.registerPublicEntity(DOC_PUBLICID_12, c,
"/meta/struts-config_1_2.dtd");
} catch (Exception e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorRecognizer.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorRecognizer.java 2007-07-20
14:15:20 UTC (rev 2552)
+++
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validators/model/FileValidatorRecognizer.java 2007-07-20
14:49:42 UTC (rev 2553)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.struts.validators.model;
-import org.eclipse.core.runtime.FileLocator;
import org.jboss.tools.common.model.loaders.*;
import org.jboss.tools.common.xml.XMLEntityResolver;
import org.jboss.tools.struts.StrutsModelPlugin;
@@ -18,8 +17,8 @@
public class FileValidatorRecognizer implements EntityRecognizer, ValidatorConstants {
static {
try {
- XMLEntityResolver.registerPublicEntity(DOC_PUBLICID,
FileLocator.resolve(FileValidatorRecognizer.class.getResource("/meta/validator_1_0.dtd")).toString());
- XMLEntityResolver.registerPublicEntity(DOC_PUBLICID_11,
FileLocator.resolve(FileValidatorRecognizer.class.getResource("/meta/validator_1_1_3.dtd")).toString());
+ XMLEntityResolver.registerPublicEntity(DOC_PUBLICID,
FileValidatorRecognizer.class, "/meta/validator_1_0.dtd");
+ XMLEntityResolver.registerPublicEntity(DOC_PUBLICID_11,
FileValidatorRecognizer.class, "/meta/validator_1_1_3.dtd");
} catch (Exception e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
Show replies by date