Skip to content

Commit 20e7dc8

Browse files
committed
Fix nbactions namespace, remove System.exit from ChemicalFormatParser
- Fix 4 nbactions XML files: uk.ac.ebi → com.bioinceptionlabs - ChemicalFormatParser: replace exit(1) with FileNotFoundException (CML) and continue (RXN loop) — library should not kill the JVM - Remove unused System.exit import All 135 tests pass. Author: Syed Asad Rahman <asad.rahman@bioinceptionlabs.com>
1 parent 9c37f02 commit 20e7dc8

5 files changed

Lines changed: 14 additions & 16 deletions

File tree

nbactions-local.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
1111
</goals>
1212
<properties>
13-
<exec.args>-classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
13+
<exec.args>-classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
1414
<exec.executable>java</exec.executable>
1515
</properties>
1616
</action>
@@ -24,7 +24,7 @@
2424
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
2525
</goals>
2626
<properties>
27-
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
27+
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
2828
<exec.executable>java</exec.executable>
2929
<jpda.listen>true</jpda.listen>
3030
</properties>
@@ -39,7 +39,7 @@
3939
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
4040
</goals>
4141
<properties>
42-
<exec.args>-classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
42+
<exec.args>-classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
4343
<exec.executable>java</exec.executable>
4444
</properties>
4545
</action>

nbactions-ossrh.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
1111
</goals>
1212
<properties>
13-
<exec.args>-classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
13+
<exec.args>-classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
1414
<exec.executable>java</exec.executable>
1515
</properties>
1616
</action>
@@ -24,7 +24,7 @@
2424
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
2525
</goals>
2626
<properties>
27-
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
27+
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
2828
<exec.executable>java</exec.executable>
2929
<jpda.listen>true</jpda.listen>
3030
</properties>
@@ -39,7 +39,7 @@
3939
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
4040
</goals>
4141
<properties>
42-
<exec.args>-classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
42+
<exec.args>-classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
4343
<exec.executable>java</exec.executable>
4444
</properties>
4545
</action>

nbactions-release-profile.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
1111
</goals>
1212
<properties>
13-
<exec.args>-classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
13+
<exec.args>-classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
1414
<exec.executable>java</exec.executable>
1515
</properties>
1616
</action>
@@ -24,7 +24,7 @@
2424
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
2525
</goals>
2626
<properties>
27-
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
27+
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
2828
<exec.executable>java</exec.executable>
2929
<jpda.listen>true</jpda.listen>
3030
</properties>
@@ -39,7 +39,7 @@
3939
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
4040
</goals>
4141
<properties>
42-
<exec.args>-classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
42+
<exec.args>-classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
4343
<exec.executable>java</exec.executable>
4444
</properties>
4545
</action>

nbactions.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
1111
</goals>
1212
<properties>
13-
<exec.args>-Xms4G -classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
13+
<exec.args>-Xms4G -classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
1414
<exec.executable>java</exec.executable>
1515
<exec.workingdir>/Users/asad/github/ReactionDecoder</exec.workingdir>
1616
</properties>
@@ -25,7 +25,7 @@
2525
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
2626
</goals>
2727
<properties>
28-
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -Xms4G -classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
28+
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -Xms4G -classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
2929
<exec.executable>java</exec.executable>
3030
<jpda.listen>true</jpda.listen>
3131
<exec.workingdir>/Users/asad/github/ReactionDecoder</exec.workingdir>
@@ -41,7 +41,7 @@
4141
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
4242
</goals>
4343
<properties>
44-
<exec.args>-Xms4G -classpath %classpath uk.ac.ebi.aamtool.ReactionDecoder</exec.args>
44+
<exec.args>-Xms4G -classpath %classpath com.bioinceptionlabs.aamtool.ReactionDecoder</exec.args>
4545
<exec.executable>java</exec.executable>
4646
<exec.workingdir>/Users/asad/github/ReactionDecoder</exec.workingdir>
4747
</properties>

src/main/java/com/bioinceptionlabs/aamtool/ChemicalFormatParser.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.io.FileReader;
2525
import java.io.IOException;
2626
import static java.lang.String.format;
27-
import static java.lang.System.exit;
2827
import static java.lang.System.getProperty;
2928
import java.util.ArrayList;
3029
import java.util.List;
@@ -60,8 +59,7 @@ class ChemicalFormatParser {
6059
protected static IReaction parseCML(String input) throws FileNotFoundException, CDKException {
6160
File f = new File(input);
6261
if (!f.isFile()) {
63-
LOGGER.warn(WARNING, format("CML file not found! " + f.getName()));
64-
exit(1);
62+
throw new FileNotFoundException("CML file not found: " + f.getName());
6563
}
6664
String[] split = f.getName().split("\\.cml");
6765
try (FileInputStream fis = new FileInputStream(input);
@@ -92,7 +90,7 @@ protected static List<IReaction> parseRXN(String fileNames) {
9290
File filepath = new File(fileName);
9391
if (!filepath.isFile()) {
9492
LOGGER.error(WARNING, format("RXN file not found! %s", filepath.getName()));
95-
exit(1);
93+
continue;
9694
}
9795
LOGGER.info(INFO, "Annotating Reaction {0}", filepath.getName());
9896
IReaction rxnReactions;

0 commit comments

Comments
 (0)