Author: dgolovin
Date: 2010-04-15 19:51:36 -0400 (Thu, 15 Apr 2010)
New Revision: 21510
Removed:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SafeDocumentBuilderFactory.java
Modified:
trunk/common/plugins/org.jboss.tools.common/
trunk/common/plugins/org.jboss.tools.common/.classpath
trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
trunk/struts/plugins/org.jboss.tools.struts/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-1636 Code Review
Removed redundant jars and replaced them to bundles that comes from eclipse and wtp
Property changes on: trunk/common/plugins/org.jboss.tools.common
___________________________________________________________________
Name: svn:ignore
- bin
+ bin
target
Modified: trunk/common/plugins/org.jboss.tools.common/.classpath
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/.classpath 2010-04-15 21:49:25 UTC (rev
21509)
+++ trunk/common/plugins/org.jboss.tools.common/.classpath 2010-04-15 23:51:36 UTC (rev
21510)
@@ -1,15 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry exported="true" kind="lib"
path="lib/commons-logging.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/velocity-1.3.1.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/velocity-dep-1.3.1.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/xercesImpl.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/resolver.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/commons-lang-2.0.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/commons-httpclient-3.0.jar"
sourcepath="G:/Java/ApacheCommons/commons-httpclient-3.0-src.zip"/>
- <classpathentry exported="true" kind="lib"
path="lib/commons-codec-1.3.jar"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2010-04-15 21:49:25
UTC (rev 21509)
+++ trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2010-04-15 23:51:36
UTC (rev 21510)
@@ -1,126 +1,11 @@
Manifest-Version: 1.0
Bundle-Name: %Bundle-Name.0
-Bundle-ClassPath: lib/commons-logging.jar,
- lib/velocity-1.3.1.jar,
- lib/velocity-dep-1.3.1.jar,
- lib/xercesImpl.jar,
- lib/resolver.jar,
- lib/commons-lang-2.0.jar,
- lib/commons-httpclient-3.0.jar,
- lib/commons-codec-1.3.jar,
- .
+Bundle-ClassPath: .
Bundle-Activator: org.jboss.tools.common.CommonPlugin
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.jboss.tools.common;singleton:=true
Bundle-Localization: plugin
-Export-Package: org.apache.commons.codec,
- org.apache.commons.codec.binary,
- org.apache.commons.codec.digest,
- org.apache.commons.codec.language,
-
org.apache.commons.codec.net,
- org.apache.commons.collections,
- org.apache.commons.httpclient,
- org.apache.commons.httpclient.auth,
- org.apache.commons.httpclient.cookie,
- org.apache.commons.httpclient.methods,
- org.apache.commons.httpclient.methods.multipart,
- org.apache.commons.httpclient.params,
- org.apache.commons.httpclient.protocol,
- org.apache.commons.httpclient.util,
- org.apache.commons.lang,
- org.apache.commons.lang.builder,
- org.apache.commons.lang.exception,
- org.apache.commons.lang.math,
- org.apache.commons.lang.time,
- org.apache.commons.logging,
- org.apache.commons.logging.impl,
- org.apache.html.dom,
- org.apache.log,
- org.apache.log.filter,
- org.apache.log.format,
- org.apache.log.output,
- org.apache.log.output.db,
- org.apache.log.output.io,
- org.apache.log.output.io.rotate,
- org.apache.log.output.jms,
-
org.apache.log.output.net,
- org.apache.log.util,
- org.apache.oro.io,
- org.apache.oro.text,
- org.apache.oro.text.awk,
- org.apache.oro.text.perl,
- org.apache.oro.text.regex,
- org.apache.oro.util,
- org.apache.velocity,
- org.apache.velocity.anakia,
- org.apache.velocity.app,
- org.apache.velocity.app.event,
- org.apache.velocity.app.tools,
- org.apache.velocity.context,
- org.apache.velocity.convert,
- org.apache.velocity.exception,
- org.apache.velocity.io,
- org.apache.velocity.runtime,
- org.apache.velocity.runtime.compiler,
- org.apache.velocity.runtime.configuration,
- org.apache.velocity.runtime.directive,
- org.apache.velocity.runtime.exception,
- org.apache.velocity.runtime.log,
- org.apache.velocity.runtime.parser,
- org.apache.velocity.runtime.parser.node,
- org.apache.velocity.runtime.resource,
- org.apache.velocity.runtime.resource.loader,
- org.apache.velocity.runtime.visitor,
- org.apache.velocity.servlet,
- org.apache.velocity.test,
- org.apache.velocity.test.misc,
- org.apache.velocity.test.provider,
- org.apache.velocity.test.view,
- org.apache.velocity.texen,
- org.apache.velocity.texen.ant,
- org.apache.velocity.texen.util,
- org.apache.velocity.util,
- org.apache.velocity.util.introspection,
- org.apache.wml,
- org.apache.wml.dom,
- org.apache.xerces.dom,
- org.apache.xerces.dom.events,
- org.apache.xerces.dom3,
- org.apache.xerces.dom3.as,
- org.apache.xerces.dom3.bootstrap,
- org.apache.xerces.impl,
- org.apache.xerces.impl.dtd,
- org.apache.xerces.impl.dtd.models,
- org.apache.xerces.impl.dv,
- org.apache.xerces.impl.dv.dtd,
- org.apache.xerces.impl.dv.util,
- org.apache.xerces.impl.dv.xs,
- org.apache.xerces.impl.io,
- org.apache.xerces.impl.msg,
- org.apache.xerces.impl.validation,
- org.apache.xerces.impl.xpath,
- org.apache.xerces.impl.xpath.regex,
- org.apache.xerces.impl.xs,
- org.apache.xerces.impl.xs.identity,
- org.apache.xerces.impl.xs.models,
- org.apache.xerces.impl.xs.opti,
- org.apache.xerces.impl.xs.traversers,
- org.apache.xerces.impl.xs.util,
- org.apache.xerces.jaxp,
- org.apache.xerces.parsers,
- org.apache.xerces.util,
- org.apache.xerces.xinclude,
- org.apache.xerces.xni,
- org.apache.xerces.xni.grammars,
- org.apache.xerces.xni.parser,
- org.apache.xerces.xs,
- org.apache.xml.resolver,
- org.apache.xml.resolver.apps,
- org.apache.xml.resolver.helpers,
- org.apache.xml.resolver.readers,
- org.apache.xml.resolver.tools,
- org.apache.xml.serialize,
- org.jboss.tools.common,
+Export-Package: org.jboss.tools.common,
org.jboss.tools.common.java,
org.jboss.tools.common.log,
org.jboss.tools.common.preferences,
@@ -128,9 +13,7 @@
org.jboss.tools.common.text,
org.jboss.tools.common.util,
org.jboss.tools.common.xml,
- org.jboss.tools.common.zip,
- org.w3c.dom.html,
- org.w3c.dom.ls
+ org.jboss.tools.common.zip
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.wst.xml.core;visibility:=reexport,
org.eclipse.jface,
@@ -142,7 +25,8 @@
org.eclipse.jdt.core,
org.eclipse.jdt.ui,
org.eclipse.ui.workbench.texteditor,
- org.eclipse.jface.text
+ org.eclipse.jface.text,
+ org.apache.commons.httpclient;bundle-version="3.1.0"
Bundle-Version: 2.0.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ManifestVersion: 2
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java 2010-04-15
21:49:25 UTC (rev 21509)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java 2010-04-15
23:51:36 UTC (rev 21510)
@@ -34,8 +34,9 @@
/**
* @author eskimo(dgolovin(a)exadel.com)
- * @version $Revision:$
+ * @version $Revision:$
*/
+
public class SAXValidator {
protected static final String FATAL_ERROR_PROCESSING_FEATURE_ID =
"http://apache.org/xml/features/continue-after-fatal-error"; //$NON-NLS-1$
Deleted:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SafeDocumentBuilderFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SafeDocumentBuilderFactory.java 2010-04-15
21:49:25 UTC (rev 21509)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SafeDocumentBuilderFactory.java 2010-04-15
23:51:36 UTC (rev 21510)
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.xml;
-
-import java.io.ByteArrayInputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.jboss.tools.common.CommonPlugin;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-public class SafeDocumentBuilderFactory extends Thread {
- public static final EntityResolver EMPTY_RESOLVER = new EntityResolver() {
- public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
throws SAXException, java.io.IOException {
- if((systemId != null) && systemId.toLowerCase().endsWith(".dtd")) {
// this deactivates DTD //$NON-NLS-1$
- return new InputSource(new ByteArrayInputStream("<?xml version='1.0'
encoding='UTF-8'?>".getBytes())); //$NON-NLS-1$
- } else {
- return null;
- }
- }
- };
- DocumentBuilder d = null;
- boolean validate = false;
-
- private SafeDocumentBuilderFactory(boolean validate) {
- this.validate = validate;
- }
-
- @Override
- public void run () {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- try {
- DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
- if(validate) {
- f.setValidating(validate);
- }
-/// f.setExpandEntityReferences(false);
- d = f.newDocumentBuilder();
- if(!validate) {
- d.setEntityResolver(EMPTY_RESOLVER);
- }
- d.setErrorHandler(new ErrorHandlerImpl());
- } catch (ParserConfigurationException e) {
- CommonPlugin.getPluginLog().logError(e);
- } finally {
- Thread.currentThread().setContextClassLoader(loader);
- }
- }
-
- public static DocumentBuilder createDocumentBuilder(boolean validating) {
-/*
- * This Thread call is workaround that except empty thread Context ClassLoader
- */
- SafeDocumentBuilderFactory t = new SafeDocumentBuilderFactory(validating);
- try {
- t.start();
- t.join();
- } catch (InterruptedException e) {
- t.run();
- }
- return t.d;
- }
-
-}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java 2010-04-15
21:49:25 UTC (rev 21509)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/XMLUtilities.java 2010-04-15
23:51:36 UTC (rev 21510)
@@ -65,8 +65,7 @@
}
public static Element getUniqueChild(Element parent, String name){
- Element[] e = getChildren(parent, name);
- return (e.length == 0) ? null : e[0];
+ return getFirstChild(parent, name);
}
public static Element getFirstChild(Element parent, String name) {
@@ -105,18 +104,20 @@
public static Element createElement(Element parent, String path) {
int i = path.indexOf('.');
+ Element element = null;
if(i < 0) {
- Element element = parent.getOwnerDocument().createElement(path);
+ element = parent.getOwnerDocument().createElement(path);
parent.appendChild(element);
- return element;
+ } else {
+ String p = path.substring(0, i), c = path.substring(i + 1);
+ Element pe = getUniqueChild(parent, p);
+ if(pe == null) {
+ pe = parent.getOwnerDocument().createElement(p);
+ parent.appendChild(pe);
+ }
+ element = createElement(pe, c);
}
- String p = path.substring(0, i), c = path.substring(i + 1);
- Element pe = getUniqueChild(parent, p);
- if(pe == null) {
- pe = parent.getOwnerDocument().createElement(p);
- parent.appendChild(pe);
- }
- return createElement(pe, c);
+ return element;
}
public static DocumentBuilder createDocumentBuilder() {
@@ -126,9 +127,7 @@
public static DocumentBuilder createDocumentBuilder(boolean validate) {
try {
DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
- if (validate) {
- f.setValidating(validate);
- }
+ f.setValidating(validate);
// / f.setExpandEntityReferences(false);
DocumentBuilder d = f.newDocumentBuilder();
if (!validate) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF 2010-04-15 21:49:25
UTC (rev 21509)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF 2010-04-15 23:51:36
UTC (rev 21510)
@@ -39,6 +39,8 @@
org.eclipse.debug.ui,
org.jboss.tools.jst.jsp;bundle-version="2.0.0",
org.eclipse.jface.text;bundle-version="3.5.0",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.1.300"
+ org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.1.300",
+ org.apache.velocity;bundle-version="1.5.0"
Bundle-Version: 2.0.0
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ClassPath: .
Modified: trunk/struts/plugins/org.jboss.tools.struts/META-INF/MANIFEST.MF
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/META-INF/MANIFEST.MF 2010-04-15 21:49:25
UTC (rev 21509)
+++ trunk/struts/plugins/org.jboss.tools.struts/META-INF/MANIFEST.MF 2010-04-15 23:51:36
UTC (rev 21510)
@@ -52,7 +52,8 @@
org.eclipse.ltk.core.refactoring,
org.eclipse.ltk.ui.refactoring,
org.eclipse.core.resources,
- org.eclipse.core.runtime
+ org.eclipse.core.runtime,
+ org.apache.velocity;bundle-version="1.5.0"
Bundle-Version: 2.0.0
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ManifestVersion: 2