File tree Expand file tree Collapse file tree 2 files changed +385
-10
lines changed
main/java/org/apache/maven/impl/model
test/java/org/apache/maven/impl/model Expand file tree Collapse file tree 2 files changed +385
-10
lines changed Original file line number Diff line number Diff line change @@ -114,9 +114,9 @@ public Model read(XmlReaderRequest request) throws IOException {
114114 }
115115 try {
116116 return doRead (request );
117- } catch (IOException e ) {
118- exceptions .forEach (e ::addSuppressed );
119- throw e ;
117+ } catch (RuntimeException ex ) {
118+ exceptions .forEach (ex ::addSuppressed );
119+ throw ex ;
120120 }
121121 } else {
122122 return doRead (request );
@@ -126,18 +126,14 @@ public Model read(XmlReaderRequest request) throws IOException {
126126 private Path doLocateExistingPom (Path project ) {
127127 if (project == null ) {
128128 project = Paths .get (System .getProperty ("user.dir" ));
129- }
130- if (Files .isDirectory (project )) {
129+ } else if (Files .isDirectory (project )) {
131130 Path pom = project .resolve ("pom.xml" );
132131 return Files .isRegularFile (pom ) ? pom : null ;
133- } else if (Files .isRegularFile (project )) {
134- return project ;
135- } else {
136- return null ;
137132 }
133+ return project ;
138134 }
139135
140- private Model doRead (XmlReaderRequest request ) throws IOException {
136+ private Model doRead (XmlReaderRequest request ) {
141137 return modelXmlFactory .read (request );
142138 }
143139}
You can’t perform that action at this time.
0 commit comments