Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » XSDImporter.java cannot run headless
XSDImporter.java cannot run headless [message #598036] Wed, 26 April 2006 23:24
Scott Hendrickson is currently offline Scott Hendrickson
Messages: 69
Registered: July 2009
Member
When converting XSD to ECore headless, I would get a
NullPointerException in XSDImporter.java when there were errors or
warnings in my schema:

Exception in thread "main" java.lang.NullPointerException at
org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)

This was because it was trying to get the plugin instance, which is null
when running headless. Below is a patch to use a plugin id directly
"org.eclipse.xsd.ecore.importer". This seems to coincide with the
OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.

Could this patch be applied?

Thanks,
-- Scott




### Eclipse Workspace Patch 1.0
#P org.eclipse.xsd.ecore.importer
Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
============================================================ =======
RCS file:
/cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
retrieving revision 1.8
diff -u -r1.8 XSDImporter.java
--- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec 2005
08:00:01 -0000 1.8
+++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr 2006
03:14:12 -0000
@@ -139,7 +139,7 @@
List information = (List)i.next();
diagnostic.add(new BasicDiagnostic(
"error".equals(information.get(0)) ? Diagnostic.ERROR :
"warning".equals(information.get(0)) ? Diagnostic.WARNING : Diagnostic.INFO,
- XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
+ "org.eclipse.xsd.ecore.importer",
0,
(String)information.get(1),
null));
Previous Topic:Inheritance Problem
Next Topic:XSDImporter.java cannot run headless
Goto Forum:
  


Current Time: Thu Jul 31 01:44:34 EDT 2014

Powered by FUDForum. Page generated in 0.01527 seconds