Commit 91e97f6a authored by Luc Maisonobe's avatar Luc Maisonobe

Added some protections against malformed SP3 files.

parent 34297e09
......@@ -67,7 +67,22 @@ public class SP3File implements OrbitFile, Serializable {
/** broadcast. */
BCT,
/** fitted after applying a Helmert transformation. */
HLM
HLM;
/** Parse a string to get the type.
* @param s string to parse
* @return the type corresponding to the string
* @exception IllegalArgumentException if the string does not correspond to a type
*/
public static SP3OrbitType parseType(final String s) {
final String normalizedString = s.trim().toUpperCase();
if ("EST".equals(normalizedString)) {
return FIT;
} else {
return valueOf(normalizedString);
}
}
}
/** File type. */
......
......@@ -114,12 +114,10 @@ public class SP3Parser implements OrbitFileParser {
boolean done = false;
do {
line = reader.readLine();
if (line != null) {
if ("EOF".equalsIgnoreCase(line)) {
done = true;
} else if (line.length() > 0) {
parseContentLine(line, pi);
}
if (line == null || "EOF".equalsIgnoreCase(line.trim())) {
done = true;
} else if (line.length() > 0) {
parseContentLine(line, pi);
}
} while (!done);
} finally {
......
......@@ -22,6 +22,9 @@
<body>
<release version="7.2" date="TBC"
description="">
<action dev="luc" type="fix">
Added some protections against malformed SP3 files.
</action>
<action dev="luc" type="fix">
Fixed Newcomb operators generation in DSST for high degree gravity fields.
Fixes issue #237
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment