Skip to content

Commit 476293e

Browse files
committed
Adjust and use the embedded JXpath
1 parent 048f7ab commit 476293e

File tree

3 files changed

+3
-33
lines changed

3 files changed

+3
-33
lines changed

bundles/org.eclipse.e4.emf.xpath/META-INF/MANIFEST.MF

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,5 @@ Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.35.0",
99
Export-Package: org.eclipse.e4.emf.internal.xpath;x-internal:=true,
1010
org.eclipse.e4.emf.internal.xpath.helper;x-friends:="org.eclipse.e4.emf.xpath.test,org.eclipse.e4.ui.model.workbench,org.eclipse.e4.ui.workbench",
1111
org.eclipse.e4.emf.xpath
12-
Import-Package: org.apache.commons.jxpath;version="[1.3.0,2.0.0)",
13-
org.apache.commons.jxpath.ri;version="[1.3.0,2.0.0)",
14-
org.apache.commons.jxpath.ri.compiler;version="[1.3.0,2.0.0)",
15-
org.apache.commons.jxpath.ri.model;version="[1.3.0,2.0.0)",
16-
org.apache.commons.jxpath.util;version="[1.3.0,2.0.0)"
1712
Bundle-Vendor: %Bundle-Vendor
1813
Automatic-Module-Name: org.eclipse.e4.emf.xpath

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,6 @@ public class JXPathContextReferenceImpl extends JXPathContext {
8888
nodeFactories.add(domFactory);
8989
}
9090

91-
// JDOM factory is only registered if JDOM is on the classpath
92-
final Object jdomFactory = allocateConditionally(
93-
"org.apache.commons.jxpath.ri.model.jdom.JDOMPointerFactory",
94-
"org.jdom.Document");
95-
if (jdomFactory != null) {
96-
nodeFactories.add(jdomFactory);
97-
}
98-
99-
// DynaBean factory is only registered if BeanUtils are on the classpath
100-
final Object dynaBeanFactory =
101-
allocateConditionally(
102-
"org.apache.commons.jxpath.ri.model.dynabeans."
103-
+ "DynaBeanPointerFactory",
104-
"org.apache.commons.beanutils.DynaBean");
105-
if (dynaBeanFactory != null) {
106-
nodeFactories.add(dynaBeanFactory);
107-
}
108-
10991
nodeFactories.add(new ContainerPointerFactory());
11092
createNodeFactoryArray();
11193
}
@@ -119,8 +101,8 @@ private static synchronized void createNodeFactoryArray() {
119101
(NodePointerFactory[]) nodeFactories.
120102
toArray(new NodePointerFactory[nodeFactories.size()]);
121103
Arrays.sort(nodeFactoryArray, (a, b) -> {
122-
final int orderA = ((NodePointerFactory) a).getOrder();
123-
final int orderB = ((NodePointerFactory) b).getOrder();
104+
final int orderA = a.getOrder();
105+
final int orderB = b.getOrder();
124106
return orderA - orderB;
125107
});
126108
}

bundles/org.eclipse.e4.emf.xpath/src/org/apache/commons/jxpath/util/BasicTypeConverter.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
import java.util.Set;
3030
import java.util.SortedSet;
3131

32-
import org.apache.commons.beanutils.ConvertUtils;
33-
import org.apache.commons.beanutils.Converter;
3432
import org.apache.commons.jxpath.JXPathInvalidAccessException;
3533
import org.apache.commons.jxpath.JXPathTypeConversionException;
3634
import org.apache.commons.jxpath.NodeSet;
@@ -141,7 +139,7 @@ public boolean canConvert(final Object object, final Class toType) {
141139
if (object instanceof Pointer) {
142140
return canConvert(((Pointer) object).getValue(), useType);
143141
}
144-
return ConvertUtils.lookup(useType) != null;
142+
return false;
145143
}
146144

147145
/**
@@ -268,11 +266,6 @@ public Object convert(final Object object, final Class toType) {
268266
}
269267
}
270268

271-
final Converter converter = ConvertUtils.lookup(useType);
272-
if (converter != null) {
273-
return converter.convert(useType, object);
274-
}
275-
276269
throw new JXPathTypeConversionException("Cannot convert "
277270
+ object.getClass() + " to " + useType);
278271
}

0 commit comments

Comments
 (0)