Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[ FIXED JENKINS-20070] Clear SAX system property afterwards.
  • Loading branch information
uhafner committed Jan 30, 2014
1 parent e65c690 commit 7c3d7fe
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/main/java/hudson/plugins/checkstyle/CheckStylePlugin.java
@@ -1,6 +1,6 @@
package hudson.plugins.checkstyle;

import org.apache.xerces.parsers.SAXParser;
import hudson.plugins.analysis.util.SaxSetup;

import hudson.Plugin;

Expand All @@ -12,18 +12,15 @@
* @author Ulli Hafner
*/
public class CheckStylePlugin extends Plugin {
/** Property of SAX parser factory. */
static final String SAX_DRIVER_PROPERTY = "org.xml.sax.driver";

@Override
public void start() {
String oldProperty = System.getProperty(SAX_DRIVER_PROPERTY);
System.setProperty(SAX_DRIVER_PROPERTY, SAXParser.class.getName());

CheckStyleRules.getInstance().initialize();
SaxSetup sax = new SaxSetup();

if (oldProperty != null) {
System.setProperty(SAX_DRIVER_PROPERTY, oldProperty);
try {
CheckStyleRules.getInstance().initialize();
}
finally {
sax.cleanup();
}
}
}

0 comments on commit 7c3d7fe

Please sign in to comment.