Skip to content

Commit 6763e5b

Browse files
committed
RIA-26438 SoapUI: update dom4j
1 parent d6fd1a4 commit 6763e5b

3 files changed

Lines changed: 10 additions & 42 deletions

File tree

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<commons-cli.version>1.2</commons-cli.version>
112112
<json-lib.version>2.2.2-jdk15</json-lib.version>
113113
<ezmorph.version>1.0.5</ezmorph.version>
114-
<xom.version>1.1</xom.version>
114+
<xom.version>1.4.1</xom.version>
115115
<commons-codec.version>1.10</commons-codec.version>
116116
<rhino-js.version>1.7R2</rhino-js.version>
117117
<saxon.version>9.1.0.8j</saxon.version>
@@ -131,7 +131,7 @@
131131
<commons-httpclient.version>3.1</commons-httpclient.version>
132132
<i4jruntime.version>5.1.14</i4jruntime.version>
133133
<animal-sniffer-annotations.version>1.11</animal-sniffer-annotations.version>
134-
<reflections.version>0.9.9-RC1</reflections.version>
134+
<reflections.version>0.10.2</reflections.version>
135135
<install4j-maven-plugin.version>1.1.1</install4j-maven-plugin.version>
136136
<io.cucumber.version>7.20.1</io.cucumber.version>
137137
<picocontainer.version>2.14.3</picocontainer.version>

soapui/src/main/java/com/eviware/soapui/plugins/LoaderBase.java

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@
3131
import com.eviware.soapui.support.listener.ListenerRegistry;
3232
import org.apache.commons.lang.ObjectUtils;
3333
import org.reflections.Reflections;
34-
import org.reflections.adapters.JavaReflectionAdapter;
35-
import org.reflections.scanners.SubTypesScanner;
34+
import org.reflections.scanners.Scanners;
3635
import org.reflections.util.ClasspathHelper;
3736
import org.reflections.util.ConfigurationBuilder;
38-
import org.reflections.vfs.Vfs;
3937
import org.slf4j.Logger;
4038
import org.slf4j.LoggerFactory;
4139

@@ -101,8 +99,8 @@ protected Collection<? extends SoapUIFactory> registerFactories(Collection<? ext
10199
protected void loadAutoFactories(Reflections jarFileScanner, Collection<SoapUIFactory> factories) {
102100
ConfigurationBuilder builder = new ConfigurationBuilder();
103101
builder.addUrls(ClasspathHelper.forClass(AutoFactory.class));
104-
builder.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner());
105-
builder.addClassLoader(Thread.currentThread().getContextClassLoader());
102+
builder.setScanners(Scanners.SubTypes, Scanners.TypesAnnotated);
103+
builder.addClassLoaders(Thread.currentThread().getContextClassLoader());
106104
Reflections autoAnnotationFinder = new Reflections(builder);
107105

108106
for (Class clazz : autoAnnotationFinder.getTypesAnnotatedWith(AutoFactory.class)) {
@@ -373,35 +371,4 @@ private boolean isToolbarAction(SoapUIAction soapUIAction) {
373371
return annotation != null && StringUtils.hasContent(annotation.toolbarIcon());
374372
}
375373

376-
// due to Reflections internals (or my misunderstanding of them) this class has to be
377-
// named as its superclass
378-
protected static class TypeAnnotationsScanner extends org.reflections.scanners.TypeAnnotationsScanner {
379-
@Override
380-
public boolean acceptsInput(String file) {
381-
if (file.endsWith(".groovy")) {
382-
return true;
383-
} else {
384-
return super.acceptsInput(file);
385-
}
386-
}
387-
}
388-
389-
// loads both groovy and java classes for Reflections package
390-
protected static class GroovyAndJavaReflectionAdapter extends JavaReflectionAdapter {
391-
392-
private final JarClassLoader jarClassLoader;
393-
394-
public GroovyAndJavaReflectionAdapter(JarClassLoader jarClassLoader) {
395-
this.jarClassLoader = jarClassLoader;
396-
}
397-
398-
@Override
399-
public Class getOfCreateClassObject(Vfs.File file) throws Exception {
400-
if (file.getName().endsWith(".groovy")) {
401-
return jarClassLoader.loadScriptClass(file.getRelativePath());
402-
} else {
403-
return super.getOfCreateClassObject(file, jarClassLoader);
404-
}
405-
}
406-
}
407374
}

soapui/src/main/java/com/eviware/soapui/plugins/PluginLoader.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ private ReflectionsAndClassLoader makeJarFileScanner(File pluginFile, Collection
6161
tempFile.deleteOnExit();
6262
FileUtils.copyFile(pluginFile, tempFile);
6363
JarClassLoader jarClassLoader = new JarClassLoader(tempFile, PluginLoader.class.getClassLoader(), dependencyClassLoaders);
64-
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().setUrls(jarClassLoader.getURLs()).addClassLoader(jarClassLoader);
64+
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
65+
.setUrls(jarClassLoader.getURLs())
66+
.addClassLoaders(jarClassLoader);
6567

6668
if (jarClassLoader.hasScripts()) {
67-
configurationBuilder.addClassLoader(jarClassLoader.getScriptClassLoader());
68-
configurationBuilder.addScanners(new TypeAnnotationsScanner());
69-
configurationBuilder.setMetadataAdapter(new GroovyAndJavaReflectionAdapter(jarClassLoader));
69+
configurationBuilder.addClassLoaders(jarClassLoader.getScriptClassLoader())
70+
.addScanners(new TypeAnnotationsScanner());
7071
}
7172

7273
return new ReflectionsAndClassLoader(new Reflections(configurationBuilder), jarClassLoader);

0 commit comments

Comments
 (0)