Changeset 6469
- Timestamp:
- Nov 4, 2021, 11:26:45 AM (15 months ago)
- Location:
- extensions/net.sf.basedb.reggie/branches/4.33-stable/src/net/sf/basedb/reggie/plugins/cmd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/branches/4.33-stable/src/net/sf/basedb/reggie/plugins/cmd/DemuxInfo.java
r6240 r6469 39 39 software = demuxSection.getRequiredEntry("Software", SoftwareValidator.INSTANCE); 40 40 readString = demuxSection.getRequiredEntry("ReadString", PatternValidator.READ_STRING); 41 pfReads = mergeSection.getRequiredEntry("PF_READS", LongValidator.POSITIVE.warnIf( 10000000l, null)); // Warn if less than 10M reads41 pfReads = mergeSection.getRequiredEntry("PF_READS", LongValidator.POSITIVE.warnIf(20000000l, 50000000l)); // Warn if less than 20M or more than 50M reads 42 42 reads = pfReads; // 43 43 valid = !demuxSection.hasError() && !mergeSection.hasError(); -
extensions/net.sf.basedb.reggie/branches/4.33-stable/src/net/sf/basedb/reggie/plugins/cmd/IntValidator.java
r6217 r6469 104 104 catch (Exception ex) 105 105 { 106 section.addErrorMessage("Invalid integer in JSON: "+entryKey+"="+value);106 section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value); 107 107 } 108 108 } … … 111 111 if (minValue != null && result < minValue) 112 112 { 113 section.addErrorMessage("Invalid integer in JSON: "+entryKey+"="+value+" (expected >="+minValue+")");113 section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value+" (expected >="+minValue+")"); 114 114 result = null; 115 115 } 116 116 if (maxValue != null && result > maxValue) 117 117 { 118 section.addErrorMessage("Invalid integer in JSON: "+entryKey+"="+value+" (expected <="+maxValue+")");118 section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value+" (expected <="+maxValue+")"); 119 119 result = null; 120 120 } … … 123 123 if (allowed.indexOf(result) == -1) 124 124 { 125 section.addErrorMessage("Invalid integer in JSON: "+entryKey+"="+value+" (expected one of "+allowed+")");125 section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value+" (expected one of "+allowed+")"); 126 126 result = null; 127 127 } … … 132 132 if (softMin != null && result < softMin) 133 133 { 134 section.addWarningMessage(" Unexpected integer in JSON: "+entryKey+"="+value+" (expected >="+softMin+")");134 section.addWarningMessage("Low value for "+entryKey+" in JSON: "+value+" (expected >="+softMin+")"); 135 135 } 136 136 if (softMax != null && result > softMax) 137 137 { 138 section.addWarningMessage(" Unexpected integer in JSON: "+entryKey+"="+value+" (expected <="+softMax+")");138 section.addWarningMessage("High value for "+entryKey+" in JSON: "+value+" (expected <="+softMax+")"); 139 139 } 140 140 } -
extensions/net.sf.basedb.reggie/branches/4.33-stable/src/net/sf/basedb/reggie/plugins/cmd/LongValidator.java
r6459 r6469 2 2 3 3 import java.util.List; 4 import java.util.Locale; 4 5 5 6 import net.sf.basedb.core.DbControl; … … 119 120 catch (Exception ex) 120 121 { 121 section.addErrorMessage("Invalid long in JSON: "+entryKey+"="+value);122 section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value); 122 123 } 123 124 } … … 126 127 if (minValue != null && result < minValue) 127 128 { 128 section.addErrorMessage("Invalid long in JSON: "+entryKey+"="+value+" (expected >="+minValue+")");129 section.addErrorMessage("Invalid "+entryKey+" in JSON: "+String.format(Locale.US, "%,d", value)+" (expected >="+String.format(Locale.US, "%,d", minValue)+")"); 129 130 result = null; 130 131 } 131 132 if (maxValue != null && result > maxValue) 132 133 { 133 section.addErrorMessage("Invalid long in JSON: "+entryKey+"="+value+" (expected <="+maxValue+")");134 section.addErrorMessage("Invalid "+entryKey+" in JSON: "+String.format(Locale.US, "%,d", value)+" (expected <="+String.format(Locale.US, "%,d", maxValue)+")"); 134 135 result = null; 135 136 } … … 138 139 if (allowed.indexOf(result) == -1) 139 140 { 140 section.addErrorMessage("Invalid long in JSON: "+entryKey+"="+value+" (expected one of "+allowed+")");141 section.addErrorMessage("Invalid "+entryKey+" in JSON: "+value+" (expected one of "+allowed+")"); 141 142 result = null; 142 143 } … … 147 148 if (softMin != null && result < softMin) 148 149 { 149 section.addWarningMessage(" Unexpected long in JSON: "+entryKey+"="+value+" (expected >="+softMin+")");150 section.addWarningMessage("Low value for "+entryKey+" in JSON: "+String.format(Locale.US, "%,d", value)+" (expected >="+String.format(Locale.US, "%,d", softMin)+")"); 150 151 } 151 152 if (softMax != null && result > softMax) 152 153 { 153 section.addWarningMessage(" Unexpected long in JSON: "+entryKey+"="+value+" (expected <="+softMax+")");154 section.addWarningMessage("High value for "+entryKey+" in JSON: "+String.format(Locale.US, "%,d", value)+" (expected <="+String.format(Locale.US, "%,d", softMax)+")"); 154 155 } 155 156 }
Note: See TracChangeset
for help on using the changeset viewer.