Skip to content

Commit

Permalink
Merge pull request #75 from lifs-tools/nosml-tests
Browse files Browse the repository at this point in the history
Updated to Java 17, added XCMS examples without SML section
  • Loading branch information
nilshoffmann authored Jul 24, 2024
2 parents 992f3ce + 818f6f3 commit 273d951
Show file tree
Hide file tree
Showing 47 changed files with 15,398 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,33 +145,19 @@ public ValidationMessage toValidationMessage() throws IllegalStateException {
ValidationMessage.MessageTypeEnum level = ValidationMessage.MessageTypeEnum.INFO;
switch (getType().
getLevel()) {
case Error:
level = ValidationMessage.MessageTypeEnum.ERROR;
break;
case Info:
level = ValidationMessage.MessageTypeEnum.INFO;
break;
case Warn:
level = ValidationMessage.MessageTypeEnum.WARN;
break;
default:
throw new IllegalStateException("State " +
case Error -> level = ValidationMessage.MessageTypeEnum.ERROR;
case Info -> level = ValidationMessage.MessageTypeEnum.INFO;
case Warn -> level = ValidationMessage.MessageTypeEnum.WARN;
default -> throw new IllegalStateException("State " +
getType().
getLevel() + " is not handled in switch/case statement!");
}
ValidationMessage.CategoryEnum category = ValidationMessage.CategoryEnum.FORMAT;
switch(getType().getCategory()) {
case Format:
category = ValidationMessage.CategoryEnum.FORMAT;
break;
case Logical:
category = ValidationMessage.CategoryEnum.LOGICAL;
break;
case CrossCheck:
category = ValidationMessage.CategoryEnum.CROSS_CHECK;
break;
default:
throw new IllegalStateException("Category " +
case Format -> category = ValidationMessage.CategoryEnum.FORMAT;
case Logical -> category = ValidationMessage.CategoryEnum.LOGICAL;
case CrossCheck -> category = ValidationMessage.CategoryEnum.CROSS_CHECK;
default -> throw new IllegalStateException("Category " +
getType().
getCategory()+ " is not handled in switch/case statement!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,17 @@ public boolean add(MZTabError error) throws MZTabErrorOverflowException {
}

switch(error.getType().getLevel()) {
case Info:
case Info -> {
if(level==MZTabErrorType.Level.Warn || level==MZTabErrorType.Level.Error) {
return false;
}
break;
case Warn:
}
case Warn -> {
if(level==MZTabErrorType.Level.Error) {
return false;
}
//ERROR is always being reported
}
//ERROR is always being reported
}

Expand Down Expand Up @@ -183,16 +185,16 @@ public MZTabErrorType.Level getLevel() {
return level;
}

/**
* Define the level of the errors that are going to be store in the list.
* The incoming errors with an equal or highest level will be stored.
*
* @param level
* {@link uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType#level}
*/
public void setLevel(MZTabErrorType.Level level) {
this.level = level;
}
// /**
// * Define the level of the errors that are going to be store in the list.
// * The incoming errors with an equal or highest level will be stored.
// *
// * @param level
// * {@link uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType#level}
// */
// public void setLevel(MZTabErrorType.Level level) {
// this.level = level;
// }

/**
* Clear all errors stored in the error list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,17 @@ protected static MZTabErrorType createInfo(MZTabErrorType.Category category, Str
*/
private static MZTabErrorType createMZTabError(Category category, Level level, String keyword) {
if (MZTabStringUtils.isEmpty(keyword)) {
throw new NullPointerException(keyword + " can not empty!");
throw new NullPointerException(keyword + " can not be empty!");
}

String prefix = null;
switch (category) {
case Format:
prefix = "f_";
break;
case Logical:
prefix = "l_";
break;
case CrossCheck:
prefix = "c_";
break;
case Format -> prefix = "f_";
case Logical -> prefix = "l_";
case CrossCheck -> prefix = "c_";
}

Integer code = new Integer(MZTabProperties.getProperty(prefix + "code_" + keyword));
Integer code = Integer.valueOf(MZTabProperties.getProperty(prefix + "code_" + keyword));
String original = MZTabProperties.getProperty(prefix + "original_" + keyword);
String cause = MZTabProperties.getProperty(prefix + "cause_" + keyword);

Expand Down
Loading

0 comments on commit 273d951

Please sign in to comment.