Skip to content

Commit 42af1c9

Browse files
committed
Upgrade castor library to get rid of old xerces transitive dependency
1 parent 5332d6d commit 42af1c9

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

net.sourceforge.pmd.eclipse.plugin/META-INF/MANIFEST.MF

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ Require-Bundle: org.apache.commons.logging;bundle-version="1.0.4",
1919
Bundle-ActivationPolicy: lazy
2020
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
2121
Bundle-Vendor: %plugin.provider
22-
Bundle-ClassPath: target/lib/asm.jar,
23-
target/lib/castor.jar,
22+
Bundle-ClassPath: target/lib/aopalliance.jar,
23+
target/lib/asm.jar,
24+
target/lib/castor-xml.jar,
25+
target/lib/castor-core.jar,
26+
target/lib/commons-collections.jar,
2427
target/lib/commons-io.jar,
28+
target/lib/commons-lang.jar,
2529
target/lib/commons-lang3.jar,
2630
target/lib/commons-logging.jar,
2731
target/lib/javacc.jar,
32+
target/lib/javax.inject.jar,
2833
target/lib/jaxen.jar,
2934
target/lib/jcommander.jar,
3035
target/lib/log4j.jar,
@@ -44,6 +49,14 @@ Bundle-ClassPath: target/lib/asm.jar,
4449
target/lib/rhino.jar,
4550
target/lib/saxon-dom.jar,
4651
target/lib/saxon.jar,
52+
target/lib/spring-aop.jar,
53+
target/lib/spring-asm.jar,
54+
target/lib/spring-beans.jar,
55+
target/lib/spring-context.jar,
56+
target/lib/spring-core.jar,
57+
target/lib/spring-expression.jar,
58+
target/lib/stax.jar,
59+
target/lib/stax-api.jar,
4760
target/lib/xerces.jar,
4861
target/classes/,
4962
.

net.sourceforge.pmd.eclipse.plugin/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@
2020
<version>${pmd.version}</version>
2121
<type>pom</type>
2222
</dependency>
23+
<dependency>
24+
<groupId>log4j</groupId>
25+
<artifactId>log4j</artifactId>
26+
<version>1.2.17</version>
27+
</dependency>
2328
<dependency>
2429
<groupId>org.codehaus.castor</groupId>
25-
<artifactId>castor</artifactId>
26-
<version>1.1.2.1</version>
30+
<artifactId>castor-xml</artifactId>
31+
<version>1.3.3</version>
2732
</dependency>
2833
</dependencies>
2934

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/core/rulesets/impl/RuleSetsManagerImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
import org.apache.commons.logging.LogFactory;
5757
import org.exolab.castor.mapping.Mapping;
5858
import org.exolab.castor.mapping.MappingException;
59-
import org.exolab.castor.util.LocalConfiguration;
6059
import org.exolab.castor.xml.MarshalException;
6160
import org.exolab.castor.xml.Marshaller;
6261
import org.exolab.castor.xml.ValidationException;
@@ -123,14 +122,14 @@ public void writeToXml(RuleSets ruleSets, OutputStream output) throws PMDCoreExc
123122
LOG.debug("Storing plug-in rulesets");
124123
StringWriter writer = null;
125124
try {
126-
LocalConfiguration.getInstance().getProperties().setProperty("org.exolab.castor.indent", "true");
127-
128125
final Mapping mapping = new Mapping(this.getClass().getClassLoader());
129126
final URL mappingSpecUrl = this.getClass().getResource(RULESETS_MAPPING);
130127
mapping.loadMapping(mappingSpecUrl);
131128

132129
writer = new StringWriter();
133-
final Marshaller marshaller = new Marshaller(writer);
130+
final Marshaller marshaller = new Marshaller();
131+
marshaller.setProperty("org.exolab.castor.indent", "true");
132+
marshaller.setWriter(writer);
134133
marshaller.setMapping(mapping);
135134
marshaller.marshal(ruleSets);
136135
writer.flush();

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesManagerImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
import org.eclipse.ui.PlatformUI;
6868
import org.exolab.castor.mapping.Mapping;
6969
import org.exolab.castor.mapping.MappingException;
70-
import org.exolab.castor.util.LocalConfiguration;
7170
import org.exolab.castor.xml.MarshalException;
7271
import org.exolab.castor.xml.Marshaller;
7372
import org.exolab.castor.xml.Unmarshaller;
@@ -271,14 +270,14 @@ private void writeProjectProperties(final IProject project, final ProjectPropert
271270
throws PropertiesException {
272271
StringWriter writer = null;
273272
try {
274-
LocalConfiguration.getInstance().getProperties().setProperty("org.exolab.castor.indent", "true");
275-
276273
final Mapping mapping = new Mapping(getClass().getClassLoader());
277274
final URL mappingSpecUrl = getClass().getResource(PROPERTIES_MAPPING);
278275
mapping.loadMapping(mappingSpecUrl);
279276

280277
writer = new StringWriter();
281-
final Marshaller marshaller = new Marshaller(writer);
278+
final Marshaller marshaller = new Marshaller();
279+
marshaller.setProperty("org.exolab.castor.indent", "true");
280+
marshaller.setWriter(writer);
282281
marshaller.setMapping(mapping);
283282
marshaller.marshal(projectProperties);
284283
writer.flush();

0 commit comments

Comments
 (0)