Skip to content

Commit 98c7c91

Browse files
authored
Merge pull request #1209 from tgvaughan/patch-projectURL-errors
Prevent projectURL parsing exceptions from bubbling up.
2 parents ff4d7ec + 76df70b commit 98c7c91

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
# connect it to localhost (password: password) to observe
1818
# the graphical output of these tests.
1919

20-
FROM openjdk:11
20+
FROM debian:stable
2121
WORKDIR /beast2
2222

2323
# Install Apache Ant
24-
RUN apt-get update && apt-get install -y ant
24+
RUN apt-get update && apt-get install -y openjdk-21-jdk openjfx ant
2525

2626
# Install and configure VNC server
2727
RUN apt-get update && apt-get install -y tightvncserver twm
@@ -30,7 +30,7 @@ RUN echo password | vncpasswd -f > /root/.vnc/passwd
3030
RUN chmod 600 /root/.vnc/passwd
3131

3232
# Install BEAGLE
33-
RUN apt-get update && apt-get install -y build-essential autoconf automake libtool pkg-config
33+
RUN apt-get update && apt-get install -y build-essential autoconf automake libtool pkg-config git
3434
# use latest release v3.1.2, issue #786
3535
RUN cd /root && git clone --branch v3.1.2 --depth=1 https://github.com/beagle-dev/beagle-lib.git
3636
RUN cd /root/beagle-lib && ./autogen.sh && ./configure --prefix=/usr/local && make install

src/beast/pkgmgmt/PackageManager.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,14 @@ private static void loadURL(URL url, InputStream is, Map<String, Package> packag
381381

382382
PackageVersion packageVersion = new PackageVersion(element.getAttribute("version"));
383383

384-
if (element.hasAttribute("projectURL") &&
385-
!(pkg.getLatestVersion() != null && packageVersion.compareTo(pkg.getLatestVersion())<0))
386-
pkg.setProjectURL(new URL(element.getAttribute("projectURL")));
384+
if (element.hasAttribute("projectURL") &&
385+
!(pkg.getLatestVersion() != null && packageVersion.compareTo(pkg.getLatestVersion()) < 0)) {
386+
try {
387+
pkg.setProjectURL(new URL(element.getAttribute("projectURL")));
388+
} catch (MalformedURLException ex) {
389+
System.err.println("Error parsing projectURL: " + ex.getMessage());
390+
}
391+
}
387392

388393
Set<PackageDependency> packageDependencies = new HashSet<PackageDependency>();
389394
NodeList depNodes = element.getElementsByTagName("depends");

0 commit comments

Comments
 (0)