Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-65161] remove commons-digester2 from core and upgrade plugins to commons-digester3 #20

Merged
merged 4 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ com.ibm.team.build.hjplugin/.classpath
com.ibm.team.build.hjplugin/.jazzignore
com.ibm.team.build.hjplugin/.project
com.ibm.team.build.hjplugin/build.properties
*.iml
16 changes: 16 additions & 0 deletions com.ibm.team.build.hjplugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,28 @@
</repository>
</repositories>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<!-- 1.9.4 when this merged https://github.com/stapler/stapler/pull/211 -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-paste comment? It is not that trivial for a plugin, a core version would need to be updated

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just enforce it's the good version for digester3 we have here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually digester3 only need 1.8.3 but I try to have something higher to avoid security scan trigger

<version>1.9.3</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.ibm.team.build</groupId>
<artifactId>com.ibm.team.build.hjplugin-rtc</artifactId>
<version>${rtcJarVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-digester3</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>com.ibm.team.build</groupId>
<artifactId>com.ibm.team.build.hjplugin-rtc</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import hudson.scm.RepositoryBrowser;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;
import hudson.util.Digester2;

import java.io.File;
import java.io.FileInputStream;
Expand All @@ -29,6 +28,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.commons.digester3.Digester;
import org.xml.sax.SAXException;

public class RTCChangeLogParser extends ChangeLogParser {
Expand Down Expand Up @@ -59,7 +59,7 @@ public ChangeLogSet<? extends Entry> parse(Run build, RepositoryBrowser<?> brows
LOGGER.finest("RTCChangeLogParser.parse with Reader : Begin"); //$NON-NLS$1
try {
RTCChangeLogSet result = new RTCChangeLogSet(build, browser);
Digester2 digester = getDigester();
Digester digester = getDigester();
digester.push(result);

digester.addSetProperties("changelog"); //$NON-NLS-1$
Expand Down Expand Up @@ -133,11 +133,11 @@ public ChangeLogSet<? extends Entry> parse(Run build, RepositoryBrowser<?> brows
}
}

private Digester2 getDigester() {
private Digester getDigester() {
LOGGER.finest("RTCChangeLogParser.getDigester : Begin");
Digester2 digester;
Digester digester;
try {
digester = new Digester2();
digester = new Digester();
return digester;
} catch (Error e) {
LOGGER.log(Level.FINER, "Failed to get Digest2 error: " + e.getMessage(), e);
Expand All @@ -147,7 +147,7 @@ private Digester2 getDigester() {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
digester = new Digester2();
digester = new Digester();
return digester;
} finally {
Thread.currentThread().setContextClassLoader(classLoader);
Expand Down