DefaultModelBuilder: Rethrows wrong exception in XmlReaderException catch
Found in: maven-4.0.x branch
File: impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java (lines 1576-1583)
Severity: Low
Description
In the nested catch block where strict=false also fails to read the XML, the code rethrows the original exception e rather than the non-strict exception ne:
} catch (XmlReaderException ne) {
// still unreadable even in non-strict mode, rethrow original error
throw e; // rethrows the original `e`, not `ne`
}
This means the exception thrown doesn't reflect the actual cause of the final failure (the non-strict read attempt). The exception message and stack trace from the rethrown exception match the original strict-mode failure, not the actual final attempt.
DefaultModelBuilder: Rethrows wrong exception in XmlReaderException catch
Found in: maven-4.0.x branch
File:
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java(lines 1576-1583)Severity: Low
Description
In the nested catch block where strict=false also fails to read the XML, the code rethrows the original exception
erather than the non-strict exceptionne:This means the exception thrown doesn't reflect the actual cause of the final failure (the non-strict read attempt). The exception message and stack trace from the rethrown exception match the original strict-mode failure, not the actual final attempt.