diff --git a/cv-rule-reader/pom.xml b/cv-rule-reader/pom.xml
index 89279f2..a48c692 100644
--- a/cv-rule-reader/pom.xml
+++ b/cv-rule-reader/pom.xml
@@ -4,7 +4,7 @@
psidev.psi.tools
master-pom
- 2.0.13
+ 2.0.14-SNAPSHOT
cv-rule-reader
@@ -22,7 +22,7 @@
org.jvnet.jaxb2.maven2
maven-jaxb2-plugin
- 0.7.4
+ 0.15.1
${project.basedir}/src/main/resources/
${project.basedir}/src/main/resources/
@@ -47,17 +47,24 @@
+
+ javax.xml.bind
+ jaxb-api
+
+
com.sun.xml.bind
jaxb-impl
+
- stax
- stax
+ com.sun.xml.bind
+ jaxb-core
+
- javax.xml.bind
- jaxb-api
+ org.glassfish.jaxb
+ jaxb-xjc
diff --git a/cv-rule-reader/src/test/java/psidev/psi/tools/cvrReader/MockMemoryStreamHandler.java b/cv-rule-reader/src/test/java/psidev/psi/tools/cvrReader/MockMemoryStreamHandler.java
index 15c4692..2a788de 100644
--- a/cv-rule-reader/src/test/java/psidev/psi/tools/cvrReader/MockMemoryStreamHandler.java
+++ b/cv-rule-reader/src/test/java/psidev/psi/tools/cvrReader/MockMemoryStreamHandler.java
@@ -36,7 +36,7 @@ public class MockMemoryStreamHandler extends URLStreamHandler {
public static final String MEMORY_PROTOCOL = "memory";
- private static Map url2content = new HashMap();
+ private static Map url2content = new HashMap<>();
public static void addContent( URL url, String content ) {
url2content.put( url.toString(), content );
@@ -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.
diff --git a/object-rule-reader/pom.xml b/object-rule-reader/pom.xml
index 6534e65..feca7cb 100644
--- a/object-rule-reader/pom.xml
+++ b/object-rule-reader/pom.xml
@@ -4,7 +4,7 @@
psidev.psi.tools
master-pom
- 2.0.13
+ 2.0.14-SNAPSHOT
object-rule-reader
@@ -20,9 +20,9 @@
- com.sun.tools.xjc.maven2
- maven-jaxb-plugin
- 1.0
+ org.jvnet.jaxb2.maven2
+ maven-jaxb2-plugin
+ 0.15.1
psidev.psi.tools.objectRuleReader.mapping.jaxb
@@ -50,17 +50,24 @@
+
+ javax.xml.bind
+ jaxb-api
+
+
com.sun.xml.bind
jaxb-impl
+
- stax
- stax
+ com.sun.xml.bind
+ jaxb-core
+
- javax.xml.bind
- jaxb-api
+ org.glassfish.jaxb
+ jaxb-xjc
diff --git a/object-rule-reader/src/main/java/psidev/psi/tools/objectRuleReader/ObjectRuleReader.java b/object-rule-reader/src/main/java/psidev/psi/tools/objectRuleReader/ObjectRuleReader.java
index 6aed46b..92f1b91 100644
--- a/object-rule-reader/src/main/java/psidev/psi/tools/objectRuleReader/ObjectRuleReader.java
+++ b/object-rule-reader/src/main/java/psidev/psi/tools/objectRuleReader/ObjectRuleReader.java
@@ -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 );
}
}
@@ -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 );
}
}
diff --git a/object-rule-reader/src/test/java/psidev/psi/tools/objectRuleReader/MockMemoryStreamHandler.java b/object-rule-reader/src/test/java/psidev/psi/tools/objectRuleReader/MockMemoryStreamHandler.java
index 051f41b..761ae12 100755
--- a/object-rule-reader/src/test/java/psidev/psi/tools/objectRuleReader/MockMemoryStreamHandler.java
+++ b/object-rule-reader/src/test/java/psidev/psi/tools/objectRuleReader/MockMemoryStreamHandler.java
@@ -36,7 +36,7 @@ public class MockMemoryStreamHandler extends URLStreamHandler {
public static final String MEMORY_PROTOCOL = "memory";
- private static Map url2content = new HashMap();
+ private static Map url2content = new HashMap<>();
public static void addContent( URL url, String content ) {
url2content.put( url.toString(), content );
@@ -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.
diff --git a/ontology-config-reader/pom.xml b/ontology-config-reader/pom.xml
index dca0055..fb3c5d1 100644
--- a/ontology-config-reader/pom.xml
+++ b/ontology-config-reader/pom.xml
@@ -4,7 +4,7 @@
psidev.psi.tools
master-pom
- 2.0.13
+ 2.0.14-SNAPSHOT
ontology-config-reader
@@ -20,9 +20,9 @@
- com.sun.tools.xjc.maven2
- maven-jaxb-plugin
- 1.0
+ org.jvnet.jaxb2.maven2
+ maven-jaxb2-plugin
+ 0.15.1
psidev.psi.tools.ontologyCfgReader.mapping.jaxb
@@ -50,17 +50,24 @@
+
+ javax.xml.bind
+ jaxb-api
+
+
com.sun.xml.bind
jaxb-impl
+
- stax
- stax
+ com.sun.xml.bind
+ jaxb-core
+
- javax.xml.bind
- jaxb-api
+ org.glassfish.jaxb
+ jaxb-xjc
diff --git a/ontology-config-reader/src/main/java/psidev/psi/tools/ontologyConfigReader/OntologyConfigReader.java b/ontology-config-reader/src/main/java/psidev/psi/tools/ontologyConfigReader/OntologyConfigReader.java
index 7d99bde..bbbfb5a 100644
--- a/ontology-config-reader/src/main/java/psidev/psi/tools/ontologyConfigReader/OntologyConfigReader.java
+++ b/ontology-config-reader/src/main/java/psidev/psi/tools/ontologyConfigReader/OntologyConfigReader.java
@@ -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 );
}
}
@@ -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 );
}
}
diff --git a/ontology-config-reader/src/test/java/psidev/psi/tools/ontologyConfigReader/MockMemoryStreamHandler.java b/ontology-config-reader/src/test/java/psidev/psi/tools/ontologyConfigReader/MockMemoryStreamHandler.java
index f5b2565..373e159 100755
--- a/ontology-config-reader/src/test/java/psidev/psi/tools/ontologyConfigReader/MockMemoryStreamHandler.java
+++ b/ontology-config-reader/src/test/java/psidev/psi/tools/ontologyConfigReader/MockMemoryStreamHandler.java
@@ -36,7 +36,7 @@ public class MockMemoryStreamHandler extends URLStreamHandler {
public static final String MEMORY_PROTOCOL = "memory";
- private static Map url2content = new HashMap();
+ private static Map url2content = new HashMap<>();
public static void addContent( URL url, String content ) {
url2content.put( url.toString(), content );
@@ -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.
diff --git a/ontology-manager/pom.xml b/ontology-manager/pom.xml
index 3a3a2b2..3b86d6e 100644
--- a/ontology-manager/pom.xml
+++ b/ontology-manager/pom.xml
@@ -4,7 +4,7 @@
psidev.psi.tools
master-pom
- 2.0.13
+ 2.0.14-SNAPSHOT
ontology-manager
@@ -17,6 +17,7 @@
2.13
+ 2.13.4
@@ -28,17 +29,17 @@
com.fasterxml.jackson.core
jackson-databind
- 2.9.8
+ ${jackson.version}
com.fasterxml.jackson.core
jackson-core
- 2.9.8
+ ${jackson.version}
com.fasterxml.jackson.core
jackson-annotations
- 2.9.8
+ ${jackson.version}
@@ -60,9 +61,64 @@
ojdbc14
oracle
+
+ proteomics
+ proteomics-common
+
+
+ obo
+ obo
+
+
+ obo
+ bbop
+
+
+ org.geneontology
+ oboedit
+
+
+ org.geneontology
+ org.geneontology
+
+
+ jcvsii
+ jcvsii
+
+
+ com.ice
+ tar
+
+
+ xerces
+ xercesImpl
+
+
+ proteomics
+ proteomics-common
+ 1.5
+
+
+
+ obo
+ obo
+ 2.0
+
+
+
+ obo
+ bbop
+ 2.0
+
+
+ org.geneontology
+ org.geneontology
+ 1.101
+
+
uk.ac.ebi.pride.utilities
@@ -82,18 +138,6 @@
commons-logging
-
- log4j
- log4j
- 1.2.15
-
-
- javax.jms
- jms
-
-
-
-
commons-lang
commons-lang
diff --git a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/OntologyManagerContext.java b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/OntologyManagerContext.java
index 50cdf52..70d97b0 100644
--- a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/OntologyManagerContext.java
+++ b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/OntologyManagerContext.java
@@ -22,12 +22,7 @@ public class OntologyManagerContext {
private static ThreadLocal instance =
- new ThreadLocal() {
- @Override
- protected OntologyManagerContext initialValue() {
- return new OntologyManagerContext();
- }
- };
+ ThreadLocal.withInitial(() -> new OntologyManagerContext());
public static OntologyManagerContext getInstance() {
return instance.get();
diff --git a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/OntologyUtils.java b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/OntologyUtils.java
index bc8874c..7b589c2 100644
--- a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/OntologyUtils.java
+++ b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/OntologyUtils.java
@@ -39,7 +39,7 @@ public static Collection getAccessions( Collection terms
if ( terms == null ) {
return Collections.EMPTY_LIST;
}
- Collection accessions = new ArrayList( terms.size() );
+ Collection accessions = new ArrayList<>(terms.size());
for ( OntologyTermI term : terms ) {
accessions.add( term.getTermAccession() );
}
@@ -55,7 +55,7 @@ public static Collection getTermNames( Collection terms
if ( terms == null ) {
return Collections.EMPTY_LIST;
}
- Collection names = new ArrayList( terms.size() );
+ Collection names = new ArrayList<>(terms.size());
for ( OntologyTermI term : terms ) {
names.add( term.getPreferredName() );
names.addAll( term.getNameSynonyms() );
diff --git a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/local/AbstractOboLoader.java b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/local/AbstractOboLoader.java
index 75918ee..928183c 100644
--- a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/local/AbstractOboLoader.java
+++ b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/local/AbstractOboLoader.java
@@ -5,7 +5,6 @@
import psidev.psi.tools.ontology_manager.OntologyManagerContext;
import psidev.psi.tools.ontology_manager.interfaces.OntologyTermI;
import uk.ac.ebi.ols.loader.impl.BaseOBO2AbstractLoader;
-import uk.ac.ebi.ols.loader.parser.OBOFormatParser;
import uk.ac.ebi.ols.model.interfaces.Term;
import uk.ac.ebi.ols.model.interfaces.TermRelationship;
import uk.ac.ebi.ols.model.interfaces.TermSynonym;
@@ -57,22 +56,20 @@ protected O buildOntology() {
O ontology = createNewOntology();
// 1. convert and index all terms (note: at this stage we don't handle the hierarchy)
- for ( Iterator iterator = ontBean.getTerms().iterator(); iterator.hasNext(); ) {
- Term term = ( Term ) iterator.next();
-
+ for (Term term : ontBean.getTerms()) {
// convert term into a OboTerm
- T ontologyTerm = createNewOntologyTerm( term );
+ T ontologyTerm = createNewOntologyTerm(term);
final Collection synonyms = term.getSynonyms();
- if( synonyms != null ) {
- for ( TermSynonym synonym : synonyms ) {
- ontologyTerm.getNameSynonyms().add( synonym.getSynonym() );
+ if (synonyms != null) {
+ for (TermSynonym synonym : synonyms) {
+ ontologyTerm.getNameSynonyms().add(synonym.getSynonym());
}
}
- ontology.addTerm( ontologyTerm );
+ ontology.addTerm(ontologyTerm);
- if ( term.isObsolete() ) {
- ontology.addObsoleteTerm( ontologyTerm );
+ if (term.isObsolete()) {
+ ontology.addObsoleteTerm(ontologyTerm);
}
}
buildTermRelationships(ontology);
@@ -82,15 +79,11 @@ protected O buildOntology() {
protected void buildTermRelationships(O ontology) {
// 2. build hierarchy based on the relations of the Terms
- for ( Iterator iterator = ontBean.getTerms().iterator(); iterator.hasNext(); ) {
- Term term = ( Term ) iterator.next();
-
- if ( term.getRelationships() != null ) {
- for ( Iterator iterator1 = term.getRelationships().iterator(); iterator1.hasNext(); ) {
- TermRelationship relation = ( TermRelationship ) iterator1.next();
-
- ontology.addLink( relation.getObjectTerm().getIdentifier(),
- relation.getSubjectTerm().getIdentifier() );
+ for (Term term : ontBean.getTerms()) {
+ if (term.getRelationships() != null) {
+ for (TermRelationship relation : term.getRelationships()) {
+ ontology.addLink(relation.getObjectTerm().getIdentifier(),
+ relation.getSubjectTerm().getIdentifier());
}
}
}
@@ -146,11 +139,7 @@ public O parseOboFileFromJar( String jarURI ) {
private File getRegistryFile() throws OntologyLoaderException {
File ontologyDirectory = OntologyManagerContext.getInstance().getOntologyDirectory();
- File[] registry = ontologyDirectory.listFiles( new FileFilter() {
- public boolean accept( File pathname ) {
- return ONTOLOGY_REGISTRY_NAME.equals( pathname.getName() );
- }
- } );
+ File[] registry = ontologyDirectory.listFiles(pathname -> ONTOLOGY_REGISTRY_NAME.equals( pathname.getName() ));
if ( registry.length == 1 ) {
// found our file
@@ -257,10 +246,7 @@ public O parseOboFile( URL url ) throws OntologyLoaderException {
} else {
log.info( "The file is empty" );
}
- } catch ( IOException e ) {
- // optional, so just display message in the log
- log.error( "Error while deserializing the map", e );
- } catch ( ClassNotFoundException e ) {
+ } catch (IOException | ClassNotFoundException e ) {
// optional, so just display message in the log
log.error( "Error while deserializing the map", e );
}
diff --git a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/local/OntologyTemplateImpl.java b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/local/OntologyTemplateImpl.java
index e136c78..96ada4b 100644
--- a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/local/OntologyTemplateImpl.java
+++ b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/local/OntologyTemplateImpl.java
@@ -27,7 +27,7 @@ public abstract class OntologyTemplateImpl implements O
/**
* Pool of all term contained in that ontology.
*/
- protected Collection ontologyTerms = new ArrayList( 1024 );
+ protected Collection ontologyTerms = new ArrayList<>(1024);
// TODO introduce an interface for querying/updating the relationship
// TODO replace the hashmap by a Lucene index -> using a different interface !!
@@ -35,17 +35,17 @@ public abstract class OntologyTemplateImpl implements O
/**
* Represent the relationship: child -> parents.
*/
- protected final Map> parents = new HashMap>();
+ protected final Map> parents = new HashMap<>();
/**
* Represent the relationship: parent -> children.
*/
- protected final Map> children = new HashMap>();
+ protected final Map> children = new HashMap<>();
/**
* Mapping of all OboTerm by their ID.
*/
- protected Map id2ontologyTerm = new HashMap( 1024 );
+ protected Map id2ontologyTerm = new HashMap<>(1024);
/**
* Collection of root terms of that ontology. A root term is defined as follow: term having no parent.
@@ -55,7 +55,7 @@ public abstract class OntologyTemplateImpl implements O
/**
* List of all obsolete term found while loading the ontology.
*/
- protected Collection obsoleteTerms = new ArrayList();
+ protected Collection obsoleteTerms = new ArrayList<>();
/////////////////////////////
// Public methods
@@ -101,11 +101,11 @@ public void addLink( String parentId, String childId ) {
}
if ( !children.containsKey( parent ) ) {
- children.put( parent, new HashSet() );
+ children.put( parent, new HashSet<>() );
}
if ( !parents.containsKey( child ) ) {
- parents.put( child, new HashSet() );
+ parents.put( child, new HashSet<>() );
}
children.get( parent ).add( child );
@@ -162,13 +162,11 @@ public Collection getRoots() {
}
// it wasn't precalculated, then do it here...
- roots = new HashSet();
+ roots = new HashSet<>();
- for ( Iterator iterator = ontologyTerms.iterator(); iterator.hasNext(); ) {
- T ontologyTerm = iterator.next();
-
- if ( !hasParent( ontologyTerm ) ) {
- roots.add( ontologyTerm );
+ for (T ontologyTerm : ontologyTerms) {
+ if (!hasParent(ontologyTerm)) {
+ roots.add(ontologyTerm);
}
}
@@ -230,7 +228,7 @@ public Set getDirectChildren( T term ) {
}
public Set getAllParents( T term ) {
- Set parents = new HashSet();
+ Set parents = new HashSet<>();
getAllParents( term, parents );
return parents;
}
@@ -244,7 +242,7 @@ protected void getAllParents( T term, Set parents ) {
}
public Set getAllChildren( T term ) {
- Set children = new HashSet();
+ Set children = new HashSet<>();
getAllChildren( term, children );
return children;
}
diff --git a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/ols/AbstractOlsOntology.java b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/ols/AbstractOlsOntology.java
index bdccb53..147557c 100644
--- a/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/ols/AbstractOlsOntology.java
+++ b/ontology-manager/src/main/java/psidev/psi/tools/ontology_manager/impl/ols/AbstractOlsOntology.java
@@ -121,7 +121,7 @@ public void loadOntology( String ontologyID, String name, String version, String
this.ontologyID = ontologyID;
try {
Map roots = olsClient.getRootTerms( ontologyID );
- rootAccs = new HashSet();
+ rootAccs = new HashSet<>();
rootAccs.addAll( roots.keySet() );
} catch ( RemoteException e ) {
throw new IllegalStateException( "RemoteException while trying to connect to OLS." );
@@ -151,7 +151,7 @@ public void setOntologyDirectory( File directory ) {
* @return a Set of OntologyTerms that are valid (in terms of the validator).
*/
public Set getValidTerms( String accession, boolean allowChildren, boolean useTerm ) {
- Set validTerms = new HashSet();
+ Set validTerms = new HashSet<>();
T term = getTermForAccession( accession );
if ( term != null ) {
if ( useTerm ) {
@@ -506,7 +506,7 @@ public Set getDirectParents( T term ) {
* @return a Set of OntologyTermIs of the direct parents of the given term.
*/
public Set getAllParents( T term ) {
- Set allParents = new HashSet();
+ Set allParents = new HashSet<>();
addParents( term, allParents );
return allParents;
}
@@ -626,7 +626,7 @@ public Set getAllChildren( T term ) {
* @return a Set of OntologyTermI objects representing the result contained in the Map.
*/
private Set olsMap2TermSet( Map results ) {
- Set terms = new HashSet();
+ Set terms = new HashSet<>();
for ( Object o : results.keySet() ) {
Object v = results.get( o );
if ( o instanceof String && v instanceof String ) {
@@ -648,7 +648,7 @@ private Set olsMap2TermSet( Map results ) {
// This has issues finding all the child terms if the tree changes relationship types -> use getValidIDs2
@Deprecated
public Set getValidIDsOld( String id, boolean allowChildren, boolean useTerm ) {
- Set terms = new HashSet();
+ Set terms = new HashSet<>();
try {
if ( useTerm ) {
String result = olsClient.getTermById( id, ontologyID );
@@ -681,7 +681,7 @@ public Set getValidIDsOld( String id, boolean allowChildren, boolean use
@Deprecated
protected Set getValidIDs2( String id, boolean allowChildren, boolean useTerm ) {
- Set terms = new HashSet();
+ Set terms = new HashSet<>();
try {
if ( useTerm ) {
String result = olsClient.getTermById( id, ontologyID );
@@ -880,7 +880,7 @@ public synchronized Set getDirectParentsIDs( String id ) {
@Deprecated
public Set getAllChildTerms( String id ) throws RemoteException {
- Set retVal = new TreeSet();
+ Set retVal = new TreeSet<>();
appendChildTerms( retVal, getChildTerms( id ) );
return retVal;
}
diff --git a/ontology-manager/src/test/java/psidev/psi/tools/ontology_manager/OntologyManagerTest.java b/ontology-manager/src/test/java/psidev/psi/tools/ontology_manager/OntologyManagerTest.java
index 263c0a3..1d042d5 100644
--- a/ontology-manager/src/test/java/psidev/psi/tools/ontology_manager/OntologyManagerTest.java
+++ b/ontology-manager/src/test/java/psidev/psi/tools/ontology_manager/OntologyManagerTest.java
@@ -36,9 +36,6 @@ public void setup() throws OntologyLoaderException, IOException {
om.loadOntologies(is);
is.close();
Assert.assertNotNull( om );
-// for ( String id : om.getOntologyIDs() ) {
-// System.out.println( id );
-// }
}
private File getTargetDirectory() {
diff --git a/pom.xml b/pom.xml
index 9dc35b6..2176a62 100755
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
psidev.psi.tools
master-pom
pom
- 2.0.13
+ 2.0.14-SNAPSHOT
PSI :: Tools :: Master pom
@@ -14,7 +14,7 @@
Samuel Kerrien
skerrien@ebi.ac.uk
Proteomics Services Team - EBI
- http://www.ebi.ac.uk/intact
+ https://www.ebi.ac.uk/intact
0
@@ -22,7 +22,7 @@
Florian Reisinger
florian@ebi.ac.uk
Proteomics Services Team - EBI
- http://www.ebi.ac.uk/proteomics
+ https://www.ebi.ac.uk/proteomics
0
@@ -30,7 +30,7 @@
Bruno Aranda
baranda@ebi.ac.uk
Proteomics Services Team - EBI
- http://www.ebi.ac.uk/intact
+ https://www.ebi.ac.uk/intact
0
@@ -38,7 +38,7 @@
Marine Dumousseau
marine@ebi.ac.uk
Proteomics Services Team - EBI
- http://www.ebi.ac.uk/intact
+ https://www.ebi.ac.uk/intact
0
@@ -96,8 +96,8 @@
maven-compiler-plugin
3.10.1
-
- 1.5
+
+ 1.8
@@ -148,7 +148,7 @@
maven-javadoc-plugin
2.10.3
-
+
true
@@ -169,15 +169,15 @@
org.apache.maven.plugins
maven-jxr-plugin
- 2.5
+ 3.3.0
org.apache.maven.plugins
maven-pmd-plugin
- 2.4
+ 3.19.0
- 1.5
+ 1.8
utf-8
true
@@ -207,29 +207,44 @@
commons-logging
commons-logging
- 1.1
+ 1.2
commons-lang
commons-lang
- 2.3
+ 2.6
-
- com.sun.xml.bind
- jaxb-impl
- 2.1.3
-
+
stax
stax
1.2.0
+
javax.xml.bind
jaxb-api
- 2.1
+ 2.3.1
+
+
+
+ com.sun.xml.bind
+ jaxb-impl
+ 2.3.1
+
+
+
+ com.sun.xml.bind
+ jaxb-core
+ 2.3.0
+
+
+
+ org.glassfish.jaxb
+ jaxb-xjc
+ 2.3.2
@@ -243,17 +258,13 @@
-
- nexus-ebi-repo-old
- http://www.ebi.ac.uk/intact/maven/nexus/content/repositories/ebi-repo/
-
nexus-ebi-release-repo
- http://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-repo/
+ https://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-repo/
nexus-ebi-snapshot-repo
- http://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-snapshots/
+ https://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-snapshots/
@@ -262,7 +273,7 @@
pst-release
EBI Nexus Repository
- http://www.ebi.ac.uk/Tools/maven/repos/content/repositories/pst-release
+ https://www.ebi.ac.uk/Tools/maven/repos/content/repositories/pst-release
diff --git a/validator/pom.xml b/validator/pom.xml
index b30cdb5..f9cec8e 100644
--- a/validator/pom.xml
+++ b/validator/pom.xml
@@ -4,7 +4,7 @@
psidev.psi.tools
master-pom
- 2.0.13
+ 2.0.14-SNAPSHOT
validator
diff --git a/validator/src/main/java/psidev/psi/tools/validator/Context.java b/validator/src/main/java/psidev/psi/tools/validator/Context.java
index 5ec52c3..77cf4af 100644
--- a/validator/src/main/java/psidev/psi/tools/validator/Context.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/Context.java
@@ -40,7 +40,7 @@ public void setContext( String context ) {
}
public String toString() {
- StringBuffer sb = new StringBuffer( 128 );
+ StringBuilder sb = new StringBuilder( 128 );
sb.append( "Context(" );
if ( context != null ) {
sb.append( context );
diff --git a/validator/src/main/java/psidev/psi/tools/validator/Validator.java b/validator/src/main/java/psidev/psi/tools/validator/Validator.java
index e6bf6c4..1fab503 100644
--- a/validator/src/main/java/psidev/psi/tools/validator/Validator.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/Validator.java
@@ -98,22 +98,22 @@ public static void setValidationSuccessReporting(boolean validationSuccessReport
* The set of rules specific to that Validator.
* List of ObjectRuleS
*/
- private Set rules = new HashSet ();
+ private Set rules = new HashSet<>();
/**
* The map containing the set of Rules excluded by each imported object rule file
*/
- private Map> excludedRules = new HashMap>();
+ private Map> excludedRules = new HashMap<>();
/**
* The list contains all the excluded rules (recursively) for one import. It will be cleaned at each time we start the first import
*/
- private Stack> stackOfExcludedRulesPerImport = new Stack>();
+ private Stack> stackOfExcludedRulesPerImport = new Stack<>();
/**
* Contains the URL for the rules to import
*/
- private HashMap urlsForTheImportedRules = new HashMap();
+ private HashMap urlsForTheImportedRules = new HashMap<>();
/**
* The type of the file to import in the object-rule config file is a resource
@@ -401,7 +401,7 @@ private boolean processExcludedRulesDuringImport(Import importedRules){
Exclude exclusion = importedRules.getExclude();
if (exclusion.getRule() != null){
- Set excludedRulesDuringImport = new HashSet();
+ Set excludedRulesDuringImport = new HashSet<>();
if (!this.stackOfExcludedRulesPerImport.isEmpty()){
excludedRulesDuringImport.addAll(this.stackOfExcludedRulesPerImport.peek());
@@ -445,36 +445,36 @@ private void importRulesFromFile(String urlName, String typeOfImport) throws Val
if (typeOfImport != null){
- if (typeOfImport.toLowerCase().equals(RESOURCE)){
- //URL url = Validator.class.getClassLoader().getResource( urlName );
- URL url = this.getClass().getClassLoader().getResource( urlName );
-
- if (url != null){
- InputStream is = url.openStream();
- setObjectRules(is);
- isImportDone = true;
- is.close();
- }
- else{
- log.warn(" The file (" + urlName + ") to import is a resource (" + typeOfImport + ") but was not found. Try to load this url as a local file and if not, try to read the url on internet.");
- }
- }
- else if (typeOfImport.toLowerCase().equals(LOCAL_FILE)){
- if (isALocalFile(urlName)){
- loadLocalFileFrom(urlName);
+ switch (typeOfImport.toLowerCase()) {
+ case RESOURCE:
+ //URL url = Validator.class.getClassLoader().getResource( urlName );
+ URL url = this.getClass().getClassLoader().getResource(urlName);
+
+ if (url != null) {
+ InputStream is = url.openStream();
+ setObjectRules(is);
+ isImportDone = true;
+ is.close();
+ } else {
+ log.warn(" The file (" + urlName + ") to import is a resource (" + typeOfImport + ") but was not found. Try to load this url as a local file and if not, try to read the url on internet.");
+ }
+ break;
+ case LOCAL_FILE:
+ if (isALocalFile(urlName)) {
+ loadLocalFileFrom(urlName);
+ isImportDone = true;
+ } else {
+ log.warn(" The file (" + urlName + ") to import is a local file (" + typeOfImport + ") but was not found. Try to read the url on internet.");
+ }
+ break;
+ case FILE:
+ loadFileFrom(urlName);
isImportDone = true;
- }
- else {
- log.warn(" The file (" + urlName + ") to import is a local file (" + typeOfImport + ") but was not found. Try to read the url on internet.");
- }
- }
- else if (typeOfImport.toLowerCase().equals(FILE)){
- loadFileFrom(urlName);
- isImportDone = true;
- }
- else {
- log.warn(" The type of the file (" + urlName + ") to import " + typeOfImport + " is not known. You can choose 'resource' (resource of the validator), 'file' (local file on your machine), or 'url' (look on internet)." +
- " First we will try to load this file as a resource. If not found, we will look the local files and then we will try on internet.");
+ break;
+ default:
+ log.warn(" The type of the file (" + urlName + ") to import " + typeOfImport + " is not known. You can choose 'resource' (resource of the validator), 'file' (local file on your machine), or 'url' (look on internet)." +
+ " First we will try to load this file as a resource. If not found, we will look the local files and then we will try on internet.");
+ break;
}
}
else {
@@ -606,7 +606,7 @@ public void setUserPreferences( UserPreferences userPreferences ) {
* @throws ValidatorException Exception while trying to validate the input.
*/
public Collection validate( Collection> col ) throws ValidatorException {
- Collection messages = new ArrayList();
+ Collection messages = new ArrayList<>();
for ( ObjectRule rule : rules ) {
messages.addAll( validate( col, rule ) );
}
@@ -621,7 +621,7 @@ public Collection validate( Collection> col ) throws Validat
* @throws ValidatorException Exception while trying to validate the input.
*/
public Collection validate( Object objectToCheck ) throws ValidatorException {
- Collection messages = new ArrayList();
+ Collection messages = new ArrayList<>();
for ( ObjectRule rule : rules ) {
if ( rule.canCheck( objectToCheck ) ) { // apply only if rule can handle this object
messages.addAll( rule.check( objectToCheck ) );
@@ -638,7 +638,7 @@ public Collection validate( Object objectToCheck ) throws Vali
* @throws ValidatorException Exception while trying to validate the input.
*/
public Collection validate( Object objectToCheck, ObjectRule rule ) throws ValidatorException {
- Collection messages = new ArrayList();
+ Collection messages = new ArrayList<>();
if ( rule.canCheck( objectToCheck ) ) { // apply only if rule can handle this object
messages.addAll( rule.check( objectToCheck ) );
}
@@ -654,7 +654,7 @@ public Collection validate( Object objectToCheck, ObjectRule r
* @throws ValidatorException Exception while trying to validate the input.
*/
private Collection validate( Collection> col, ObjectRule rule ) throws ValidatorException {
- Collection messages = new ArrayList();
+ Collection messages = new ArrayList<>();
for ( Object aCol : col ) {
if ( rule.canCheck( aCol ) ) { // apply only if rule can handle this object
messages.addAll( rule.check( aCol ) );
@@ -677,7 +677,7 @@ public Collection checkCvMappingRules() throws ValidatorExcept
return cvRuleManager.checkCvMapping();
} else {
log.warn( "The CvRuleManager has not been set up yet." );
- return new ArrayList();
+ return new ArrayList<>();
}
}
@@ -690,7 +690,7 @@ public Collection checkCvMappingRules() throws ValidatorExcept
* @throws ValidatorException Exception while trying to validate the input.
*/
public Collection checkCvMapping( Collection> col, String xPath ) throws ValidatorException {
- Collection messages = new ArrayList();
+ Collection messages = new ArrayList<>();
// Run cv mapping check
if ( cvRuleManager != null ) {
for ( CvRule rule : cvRuleManager.getCvRules() ) {
@@ -716,7 +716,7 @@ public Collection checkCvMapping( Collection> col, String xP
* @throws ValidatorException Exception while trying to validate the input.
*/
public Collection checkCvMapping( Object o, String xPath ) throws ValidatorException {
- Collection messages = new ArrayList();
+ Collection messages = new ArrayList<>();
// Run cv mapping check
if ( cvRuleManager != null ) {
for ( CvRule rule : cvRuleManager.getCvRules() ) {
diff --git a/validator/src/main/java/psidev/psi/tools/validator/ValidatorContext.java b/validator/src/main/java/psidev/psi/tools/validator/ValidatorContext.java
index b1bdc4b..d20278c 100644
--- a/validator/src/main/java/psidev/psi/tools/validator/ValidatorContext.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/ValidatorContext.java
@@ -12,13 +12,7 @@ public class ValidatorContext {
private ValidatorConfig validatorConfig;
- private static ThreadLocal instance = new
- ThreadLocal() {
- @Override
- protected ValidatorContext initialValue() {
- return new ValidatorContext();
- }
- };
+ private static ThreadLocal instance = ThreadLocal.withInitial(() -> new ValidatorContext());
private ValidatorContext(){
this.validatorConfig = new ValidatorConfig();
diff --git a/validator/src/main/java/psidev/psi/tools/validator/ValidatorCvContext.java b/validator/src/main/java/psidev/psi/tools/validator/ValidatorCvContext.java
index 8dce7ce..dd9c49a 100644
--- a/validator/src/main/java/psidev/psi/tools/validator/ValidatorCvContext.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/ValidatorCvContext.java
@@ -42,13 +42,7 @@ public class ValidatorCvContext {
public static final Log log = LogFactory.getLog( ValidatorCvContext.class);
- private static ThreadLocal instance = new
- ThreadLocal() {
- @Override
- protected ValidatorCvContext initialValue() {
- return new ValidatorCvContext();
- }
- };
+ private static ThreadLocal instance = ThreadLocal.withInitial(() -> new ValidatorCvContext());
public static ValidatorCvContext getInstance() {
return instance.get();
@@ -59,14 +53,14 @@ public static void removeInstance() {
}
private ValidatorCvContext() {
- notRecognisedTerms = new HashMap>();
- recognisedTerms = new HashMap>();
+ notRecognisedTerms = new HashMap<>();
+ recognisedTerms = new HashMap<>();
}
public void resetRecognised() {
- recognisedTerms = new HashMap>();
+ recognisedTerms = new HashMap<>();
}
public boolean isRecognised(String xpath, String term) {
@@ -75,7 +69,7 @@ public boolean isRecognised(String xpath, String term) {
public void addRecognised(String xpath, String term) {
if (recognisedTerms.get(xpath) == null) {
- Set newSet = new HashSet();
+ Set newSet = new HashSet<>();
recognisedTerms.put(xpath, newSet);
}
recognisedTerms.get(xpath).add(term);
@@ -96,7 +90,7 @@ public Set getRecognisedTerms(String xpath) {
public void resetNotRecognised() {
- notRecognisedTerms = new HashMap>();
+ notRecognisedTerms = new HashMap<>();
}
public boolean isNotRecognised(String xpath, String term) {
@@ -105,7 +99,7 @@ public boolean isNotRecognised(String xpath, String term) {
public void addNotRecognised(String xpath, String term) {
if (notRecognisedTerms.get(xpath) == null) {
- Set newSet = new HashSet();
+ Set newSet = new HashSet<>();
notRecognisedTerms.put(xpath, newSet);
}
notRecognisedTerms.get(xpath).add(term);
diff --git a/validator/src/main/java/psidev/psi/tools/validator/ValidatorMessage.java b/validator/src/main/java/psidev/psi/tools/validator/ValidatorMessage.java
index 642ad86..0af4baa 100644
--- a/validator/src/main/java/psidev/psi/tools/validator/ValidatorMessage.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/ValidatorMessage.java
@@ -3,6 +3,8 @@
import psidev.psi.tools.validator.rules.Rule;
import psidev.psi.tools.validator.schema.SaxMessage;
+import java.util.Objects;
+
/**
* The definition of a Validator message.
*
@@ -121,7 +123,7 @@ public boolean equals( Object o ) {
final ValidatorMessage that = (ValidatorMessage) o;
- if ( context != null ? !context.equals( that.context ) : that.context != null ) {
+ if (!Objects.equals(context, that.context)) {
return false;
}
if ( level != that.level ) {
@@ -130,7 +132,7 @@ public boolean equals( Object o ) {
if ( !message.equals( that.message ) ) {
return false;
}
- if ( rule != null ? !rule.equals( that.rule ) : that.rule != null ) {
+ if (!Objects.equals(rule, that.rule)) {
return false;
}
@@ -147,7 +149,7 @@ public int hashCode() {
}
public String toString() {
- final StringBuffer sb = new StringBuffer();
+ final StringBuilder sb = new StringBuilder();
sb.append( "ValidatorMessage" );
sb.append( "{message='" ).append( message ).append( '\'' );
sb.append( ", level=" ).append( level );
diff --git a/validator/src/main/java/psidev/psi/tools/validator/rules/AbstractRule.java b/validator/src/main/java/psidev/psi/tools/validator/rules/AbstractRule.java
index eb1f824..ed4ca48 100644
--- a/validator/src/main/java/psidev/psi/tools/validator/rules/AbstractRule.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/rules/AbstractRule.java
@@ -38,7 +38,7 @@ public abstract class AbstractRule implements Rule {
/**
* A collection of tips.
*/
- private Collection howToFixTips = new ArrayList( 1 );
+ private Collection howToFixTips = new ArrayList<>(1);
/**
* Map of needed ontologies
@@ -101,9 +101,8 @@ public String toString() {
if ( howToFixTips != null && !howToFixTips.isEmpty() ) {
sb.append( "Tip" ).append( ( howToFixTips.size() > 1 ? "s" : "" ) ).append( ':' ).append( NEW_LINE );
- for ( Iterator iterator = howToFixTips.iterator(); iterator.hasNext(); ) {
- String tip = iterator.next();
- sb.append( "\t* " ).append( tip ).append( NEW_LINE );
+ for (String tip : howToFixTips) {
+ sb.append("\t* ").append(tip).append(NEW_LINE);
}
}
diff --git a/validator/src/main/java/psidev/psi/tools/validator/rules/cvmapping/CvRule.java b/validator/src/main/java/psidev/psi/tools/validator/rules/cvmapping/CvRule.java
index c24f5cf..284eda9 100644
--- a/validator/src/main/java/psidev/psi/tools/validator/rules/cvmapping/CvRule.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/rules/cvmapping/CvRule.java
@@ -5,11 +5,9 @@
import psidev.psi.tools.validator.rules.Rule;
import psidev.psi.tools.validator.MessageLevel;
import psidev.psi.tools.cvrReader.mapping.jaxb.CvTerm;
-import psidev.psi.tools.cvrReader.mapping.jaxb.CvMappingRule;
import java.util.Collection;
import java.util.List;
-import java.util.Map;
/**
* CV Mapping Rule that is configured via XML.
diff --git a/validator/src/main/java/psidev/psi/tools/validator/rules/cvmapping/CvRuleImpl.java b/validator/src/main/java/psidev/psi/tools/validator/rules/cvmapping/CvRuleImpl.java
index e4b415d..da1dc67 100644
--- a/validator/src/main/java/psidev/psi/tools/validator/rules/cvmapping/CvRuleImpl.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/rules/cvmapping/CvRuleImpl.java
@@ -125,7 +125,7 @@ public Collection check( Object object, String prefixXpath ) t
throw new ValidatorException( "Cannot validate a null object." );
}
- Collection messages = new ArrayList();
+ Collection messages = new ArrayList<>();
if( status.equals( MappingRuleStatus.INVALID_XPATH )) {
// do not run the rule as it is not valid.
return messages;
@@ -535,12 +535,12 @@ private Map> checkValuesAgainstCvTerms( final
final Recommendation level ) {
Map> result2termCount =
- new HashMap>( valueResults.size() );
+ new HashMap<>(valueResults.size());
// check that each match (term used in the XML) has at least one matching CV term amongst those specified.
for ( XPathResult valueResult : valueResults ) { // for each term used in the XML
- Map term2count = new HashMap( getCVTerms().size() );
+ Map term2count = new HashMap<>(getCVTerms().size());
result2termCount.put( valueResult, term2count );
// for each XPath expression
@@ -767,7 +767,7 @@ public boolean equals( Object o ) {
CV cv = ( CV ) o;
- return accession.equals(cv.accession) && !(name != null ? !name.equals(cv.name) : cv.name != null);
+ return accession.equals(cv.accession) && !(!Objects.equals(name, cv.name));
}
@Override
@@ -786,7 +786,7 @@ public int hashCode() {
* @return
*/
private Map calculateCvTermUsage( Map> result2termCount ) {
- Map term2count = new HashMap();
+ Map term2count = new HashMap<>();
for ( Map.Entry> e : result2termCount.entrySet() ) {
Map t2c = e.getValue();
@@ -870,13 +870,6 @@ protected ValidatorMessage buildMessage( String xpath, Recommendation level, Str
private String printCvTerm( CvTerm cv ) {
StringBuilder sb = new StringBuilder( 512 );
-// sb.append( "CvTerm(" );
-// sb.append( '\'' ).append( cv.getTermAccession() ).append( '\'' ).append( ',' ).append( ' ' );
-// sb.append( '\'' ).append( cv.getTermName() ).append( '\'' ).append( ',' ).append( ' ' );
-// sb.append( "allowChildren:" ).append( cv.isAllowChildren() ).append( ',' ).append( ' ' );
-// sb.append( "useTerm:" ).append( cv.isUseTerm() ).append( ',' ).append( ' ' );
-// sb.append( "repeatable:" ).append( cv.isIsRepeatable() );
-// sb.append( ")" );
if ( cv.isUseTerm() && cv.isAllowChildren() ) {
sb.append(cv.getTermAccession()).append(" (").append(cv.getTermName()).append(")");
@@ -947,7 +940,7 @@ private String removeXpathPrefix( String xpath, String prefixXpath ) {
public String toString() {
- StringBuffer sb = new StringBuffer( 256 );
+ StringBuilder sb = new StringBuilder( 256 );
sb.append("[Rule: ID=");
sb.append(this.getId());
diff --git a/validator/src/main/java/psidev/psi/tools/validator/schema/SaxMessage.java b/validator/src/main/java/psidev/psi/tools/validator/schema/SaxMessage.java
index 03c0001..dcb6ebc 100755
--- a/validator/src/main/java/psidev/psi/tools/validator/schema/SaxMessage.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/schema/SaxMessage.java
@@ -134,7 +134,7 @@ public int hashCode() {
public String toString() {
- final StringBuffer sb = new StringBuffer();
+ final StringBuilder sb = new StringBuilder();
sb.append( "SaxMessage" );
sb.append( "{publicId='" ).append( publicId ).append( '\'' );
sb.append( ", systemId='" ).append( systemId ).append( '\'' );
diff --git a/validator/src/main/java/psidev/psi/tools/validator/schema/SaxReport.java b/validator/src/main/java/psidev/psi/tools/validator/schema/SaxReport.java
index 458bbe7..0343a04 100755
--- a/validator/src/main/java/psidev/psi/tools/validator/schema/SaxReport.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/schema/SaxReport.java
@@ -24,7 +24,7 @@ public class SaxReport {
private boolean valid = true;
- private List messages = new ArrayList();
+ private List messages = new ArrayList<>();
public SaxReport() {
}
diff --git a/validator/src/main/java/psidev/psi/tools/validator/util/ValidatorReport.java b/validator/src/main/java/psidev/psi/tools/validator/util/ValidatorReport.java
index 099fd75..12fd096 100644
--- a/validator/src/main/java/psidev/psi/tools/validator/util/ValidatorReport.java
+++ b/validator/src/main/java/psidev/psi/tools/validator/util/ValidatorReport.java
@@ -32,10 +32,10 @@ public class ValidatorReport {
private static final String NEW_LINE = System.getProperty( "line.separator" );
- Collection cvRulesNotChecked = new ArrayList();
- Collection cvRulesInvalidXpath = new ArrayList();
- Collection cvRulesValidXpath = new ArrayList();
- Collection cvRulesValid = new ArrayList();
+ Collection cvRulesNotChecked = new ArrayList<>();
+ Collection cvRulesInvalidXpath = new ArrayList<>();
+ Collection cvRulesValidXpath = new ArrayList<>();
+ Collection cvRulesValid = new ArrayList<>();
public ValidatorReport( Collection allCvRules ) {
splitCvRulesByStatus( allCvRules );
diff --git a/validator/src/test/java/SPEValidator.java b/validator/src/test/java/SPEValidator.java
index 4be6565..6683fdb 100755
--- a/validator/src/test/java/SPEValidator.java
+++ b/validator/src/test/java/SPEValidator.java
@@ -52,7 +52,7 @@ public Collection validate( Object experiment ) throws Validat
if( experiment == null ) throw new IllegalArgumentException( "You must give a non null experiment" );
- final Collection messages = new ArrayList();
+ final Collection messages = new ArrayList<>();
// Run Object Rules
messages.addAll( super.validate( experiment ) );
diff --git a/validator/src/test/java/psidev/psi/tools/validator/rules/cvmapping/house/ChestOfDrawers.java b/validator/src/test/java/psidev/psi/tools/validator/rules/cvmapping/house/ChestOfDrawers.java
index 3cf4d12..a0cd949 100644
--- a/validator/src/test/java/psidev/psi/tools/validator/rules/cvmapping/house/ChestOfDrawers.java
+++ b/validator/src/test/java/psidev/psi/tools/validator/rules/cvmapping/house/ChestOfDrawers.java
@@ -11,7 +11,7 @@
* @since specify the maven artifact version
*/
public class ChestOfDrawers {
- Collection drawers = new ArrayList( );
+ Collection drawers = new ArrayList<>();
public Collection getDrawers() {
return drawers;
diff --git a/validator/src/test/java/psidev/psi/tools/validator/rules/cvmapping/house/Drawer.java b/validator/src/test/java/psidev/psi/tools/validator/rules/cvmapping/house/Drawer.java
index 05aa37c..230451c 100644
--- a/validator/src/test/java/psidev/psi/tools/validator/rules/cvmapping/house/Drawer.java
+++ b/validator/src/test/java/psidev/psi/tools/validator/rules/cvmapping/house/Drawer.java
@@ -12,7 +12,7 @@
*/
public class Drawer {
- Collection extends Object> objects = new ArrayList