Skip to content

Commit

Permalink
Merge pull request #2 from ypriverol/master
Browse files Browse the repository at this point in the history
major changes in psi-tools
  • Loading branch information
EliotRagueneau authored Nov 3, 2022
2 parents 55560c9 + caf1aad commit 05ead03
Show file tree
Hide file tree
Showing 38 changed files with 281 additions and 268 deletions.
19 changes: 13 additions & 6 deletions cv-rule-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.tools</groupId>
<artifactId>master-pom</artifactId>
<version>2.0.13</version>
<version>2.0.14-SNAPSHOT</version>
</parent>

<artifactId>cv-rule-reader</artifactId>
Expand All @@ -22,7 +22,7 @@
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.4</version>
<version>0.15.1</version>
<configuration>
<schemaDirectory>${project.basedir}/src/main/resources/</schemaDirectory>
<bindingDirectory>${project.basedir}/src/main/resources/</bindingDirectory>
Expand All @@ -47,17 +47,24 @@
</dependency>

<!-- JAXB related deps -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>

<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</dependency>

<dependency>
<groupId>stax</groupId>
<artifactId>stax</artifactId>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-xjc</artifactId>
</dependency>

<!-- Tests -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class MockMemoryStreamHandler extends URLStreamHandler {

public static final String MEMORY_PROTOCOL = "memory";

private static Map<String, String> url2content = new HashMap<String, String>();
private static Map<String, String> url2content = new HashMap<>();

public static void addContent( URL url, String content ) {
url2content.put( url.toString(), content );
Expand Down Expand Up @@ -64,15 +64,12 @@ public InputStream getInputStream() throws IOException {
*/
public static void initHandler() {
try {
URL.setURLStreamHandlerFactory( new URLStreamHandlerFactory() {

public URLStreamHandler createURLStreamHandler( String protocol ) {
if ( "memory".equals( protocol ) ) {
return new MockMemoryStreamHandler();
}
return null;
URL.setURLStreamHandlerFactory(protocol -> {
if ( "memory".equals( protocol ) ) {
return new MockMemoryStreamHandler();
}
} );
return null;
});
} catch ( Throwable ex ) {
// we just ignore this exception, because m2 does not fork properly
// and URL does not like double handler definitions.
Expand Down
23 changes: 15 additions & 8 deletions object-rule-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.tools</groupId>
<artifactId>master-pom</artifactId>
<version>2.0.13</version>
<version>2.0.14-SNAPSHOT</version>
</parent>

<artifactId>object-rule-reader</artifactId>
Expand All @@ -20,9 +20,9 @@
<plugins>
<!-- Conversion of XML Schema into Java source code using JAXB-XJC -->
<plugin>
<groupId>com.sun.tools.xjc.maven2</groupId>
<artifactId>maven-jaxb-plugin</artifactId>
<version>1.0</version>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.15.1</version>
<configuration>
<generatePackage>psidev.psi.tools.objectRuleReader.mapping.jaxb</generatePackage>
<includeSchemas>
Expand Down Expand Up @@ -50,17 +50,24 @@
</dependency>

<!-- JAXB related deps -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>

<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</dependency>

<dependency>
<groupId>stax</groupId>
<artifactId>stax</artifactId>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-xjc</artifactId>
</dependency>

<!-- Tests -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ public ObjectRuleList read( String s ) throws ObjectRuleReaderException {
public ObjectRuleList read( File file ) throws ObjectRuleReaderException {
try {
return unmarshall( file );
} catch ( JAXBException e ) {
throw new ObjectRuleReaderException( e );
} catch ( FileNotFoundException e ) {
} catch (JAXBException | FileNotFoundException e ) {
throw new ObjectRuleReaderException( e );
}
}
Expand All @@ -147,9 +145,7 @@ public ObjectRuleList read( InputStream is ) throws ObjectRuleReaderException {
public ObjectRuleList read( URL url ) throws ObjectRuleReaderException {
try {
return unmarshall( url );
} catch ( JAXBException e ) {
throw new ObjectRuleReaderException( e );
} catch ( FileNotFoundException e ) {
} catch (JAXBException | FileNotFoundException e ) {
throw new ObjectRuleReaderException( e );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class MockMemoryStreamHandler extends URLStreamHandler {

public static final String MEMORY_PROTOCOL = "memory";

private static Map<String, String> url2content = new HashMap<String, String>();
private static Map<String, String> url2content = new HashMap<>();

public static void addContent( URL url, String content ) {
url2content.put( url.toString(), content );
Expand Down Expand Up @@ -64,15 +64,12 @@ public InputStream getInputStream() throws IOException {
*/
public static void initHandler() {
try {
URL.setURLStreamHandlerFactory( new URLStreamHandlerFactory() {

public URLStreamHandler createURLStreamHandler( String protocol ) {
if ( "memory".equals( protocol ) ) {
return new MockMemoryStreamHandler();
}
return null;
URL.setURLStreamHandlerFactory(protocol -> {
if ( "memory".equals( protocol ) ) {
return new MockMemoryStreamHandler();
}
} );
return null;
});
} catch ( Throwable ex ) {
// we just ignore this exception, because m2 does not fork properly
// and URL does not like double handler definitions.
Expand Down
23 changes: 15 additions & 8 deletions ontology-config-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.tools</groupId>
<artifactId>master-pom</artifactId>
<version>2.0.13</version>
<version>2.0.14-SNAPSHOT</version>
</parent>

<artifactId>ontology-config-reader</artifactId>
Expand All @@ -20,9 +20,9 @@
<plugins>
<!-- Conversion of XML Schema into Java source code using JAXB-XJC -->
<plugin>
<groupId>com.sun.tools.xjc.maven2</groupId>
<artifactId>maven-jaxb-plugin</artifactId>
<version>1.0</version>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.15.1</version>
<configuration>
<generatePackage>psidev.psi.tools.ontologyCfgReader.mapping.jaxb</generatePackage>
<includeSchemas>
Expand Down Expand Up @@ -50,17 +50,24 @@
</dependency>

<!-- JAXB related deps -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>

<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</dependency>

<dependency>
<groupId>stax</groupId>
<artifactId>stax</artifactId>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-xjc</artifactId>
</dependency>

<!-- Tests -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ public CvSourceList read( String s ) throws OntologyConfigReaderException {
public CvSourceList read( File file ) throws OntologyConfigReaderException {
try {
return unmarshall( file );
} catch ( JAXBException e ) {
throw new OntologyConfigReaderException( e );
} catch ( FileNotFoundException e ) {
} catch (JAXBException | FileNotFoundException e ) {
throw new OntologyConfigReaderException( e );
}
}
Expand All @@ -147,9 +145,7 @@ public CvSourceList read( InputStream is ) throws OntologyConfigReaderException
public CvSourceList read( URL url ) throws OntologyConfigReaderException {
try {
return unmarshall( url );
} catch ( JAXBException e ) {
throw new OntologyConfigReaderException( e );
} catch ( FileNotFoundException e ) {
} catch (JAXBException | FileNotFoundException e ) {
throw new OntologyConfigReaderException( e );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class MockMemoryStreamHandler extends URLStreamHandler {

public static final String MEMORY_PROTOCOL = "memory";

private static Map<String, String> url2content = new HashMap<String, String>();
private static Map<String, String> url2content = new HashMap<>();

public static void addContent( URL url, String content ) {
url2content.put( url.toString(), content );
Expand Down Expand Up @@ -64,15 +64,12 @@ public InputStream getInputStream() throws IOException {
*/
public static void initHandler() {
try {
URL.setURLStreamHandlerFactory( new URLStreamHandlerFactory() {

public URLStreamHandler createURLStreamHandler( String protocol ) {
if ( "memory".equals( protocol ) ) {
return new MockMemoryStreamHandler();
}
return null;
URL.setURLStreamHandlerFactory(protocol -> {
if ( "memory".equals( protocol ) ) {
return new MockMemoryStreamHandler();
}
} );
return null;
});
} catch ( Throwable ex ) {
// we just ignore this exception, because m2 does not fork properly
// and URL does not like double handler definitions.
Expand Down
Loading

0 comments on commit 05ead03

Please sign in to comment.