Skip to content

Commit

Permalink
Merge branch '918_docs' into 946_eo_warns
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/org/eolang/jeo/representation/xmir/JcabiXmlNode.java
  • Loading branch information
volodya-lombrozo committed Jan 10, 2025
2 parents e03c2dc + f83686f commit 0bc0d29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ SOFTWARE.
<dependency>
<groupId>org.eolang</groupId>
<artifactId>lints</artifactId>
<version>0.0.26</version>
<version>0.0.31</version>
</dependency>
<dependency>
<groupId>org.cactoos</groupId>
Expand Down
24 changes: 7 additions & 17 deletions src/main/java/org/eolang/jeo/representation/xmir/JcabiXmlNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@

import com.jcabi.xml.XML;
import com.jcabi.xml.XMLDocument;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.eolang.lints.Defect;
import org.eolang.lints.Program;
import org.eolang.lints.Severity;
import org.eolang.parser.StrictXmir;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Expand Down Expand Up @@ -157,21 +154,14 @@ public boolean hasAttribute(final String name, final String value) {

@Override
public void validate() {
try {
final Collection<Defect> defects = new Program(new StrictXmir(this.doc)).defects();
if (!defects.isEmpty()) {
throw new IllegalStateException(
String.format(
"XMIR is incorrect: %s, %n%s%n",
defects,
this.doc
)
);
}
} catch (final IOException exception) {
final Collection<Defect> defects = new Program(new StrictXmir(this.doc)).defects();
if (!defects.isEmpty()) {
throw new IllegalStateException(
String.format("Failed to verify XMIR document: %n%s%n", this.doc),
exception
String.format(
"XMIR is incorrect: %s, %n%s%n",
defects,
this.doc
)
);
}
}
Expand Down

0 comments on commit 0bc0d29

Please sign in to comment.