package org.osgi.impl.bundle.jaxp;

import java.util.Hashtable;

import javax.xml.parsers.*;

import org.osgi.framework.*;
import org.osgi.util.xml.XMLParserActivator;

public class JaxpActivator implements BundleActivator {

	public void start(BundleContext context) throws Exception {
		DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
		try {
			if (f != null) {
				f.setNamespaceAware(true);
				f.setValidating(true);
				Hashtable properties = new Hashtable();
				properties.put(XMLParserActivator.PARSER_NAMESPACEAWARE, Boolean.valueOf(f.isNamespaceAware()));
				properties.put(XMLParserActivator.PARSER_VALIDATING,
						Boolean.valueOf(f.isValidating()));
				context.registerService(DocumentBuilderFactory.class.getName(),
						f, properties);
			}
			else
				System.err.println("No DocumentBuilderFactory");
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		try {
			SAXParserFactory s = SAXParserFactory.newInstance();
			if (s != null) {
				s.setNamespaceAware(true);
				s.setValidating(true);
				Hashtable properties = new Hashtable();
				properties.put(XMLParserActivator.PARSER_NAMESPACEAWARE, 
						Boolean.valueOf(s.isNamespaceAware()));
				properties.put(XMLParserActivator.PARSER_VALIDATING, 
						Boolean.valueOf(s.isValidating()));
				context.registerService(SAXParserFactory.class.getName(), s,
						properties);
			}
			else
				System.err.println("No SAXParserFactory");
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void stop(BundleContext context) throws Exception {
	}
}

@@ -87,39 +87,158 @@
 ers.
-*;%0A%0Aimport org.osgi.framework.*
+DocumentBuilderFactory;%0Aimport javax.xml.parsers.SAXParserFactory;%0A%0Aimport org.osgi.framework.BundleActivator;%0Aimport org.osgi.framework.BundleContext
 ;%0Aim
@@ -338,16 +338,27 @@
 ator %7B%0A%0A
+%09@Override%0A
 %09public 
@@ -568,32 +568,47 @@
 );%0A%09%09%09%09Hashtable
+%3CString,Object%3E
  properties = ne
@@ -610,32 +610,34 @@
  = new Hashtable
+%3C%3E
 ();%0A%09%09%09%09properti
@@ -1191,16 +1191,31 @@
 ashtable
+%3CString,Object%3E
  propert
@@ -1233,16 +1233,18 @@
 ashtable
+%3C%3E
 ();%0A%09%09%09%09
@@ -1651,16 +1651,27 @@
 %09%09%7D%0A%09%7D%0A%0A
+%09@Override%0A
 %09public 
@@ -1722,13 +1722,32 @@
 ption %7B%0A
+%09%09// nothing to do%0A
 %09%7D%0A%7D%0A

Fix compiler warnings