From ccf30b9737c4f96f7b68a2e4d532f0621924740a Mon Sep 17 00:00:00 2001 From: Alekseeva Yana Date: Wed, 13 Dec 2023 13:00:35 +0300 Subject: [PATCH] fix(#2681): changed AttributeNotFoundException --- .../maven/tojos/AttributeNotFoundException.java | 12 ++++++++---- .../java/org/eolang/maven/tojos/ForeignTojo.java | 6 +----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/AttributeNotFoundException.java b/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/AttributeNotFoundException.java index 250aee956f..d77808a616 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/AttributeNotFoundException.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/AttributeNotFoundException.java @@ -25,15 +25,19 @@ /** * If the attributes were not found in the Tojo. - * @since 1.0 + * @since 0.35.0 */ public class AttributeNotFoundException extends RuntimeException { /** * Ctor. - * @param message The detail message. + * @param attribute The attribute of Tojo. */ - AttributeNotFoundException(final String message) { - super(message); + AttributeNotFoundException(final ForeignTojos.Attribute attribute) { + super( + String.format( + "There is no '%s' attribute in the tojo", attribute + ) + ); } } diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojo.java index 2e17ea12dc..79b2b2ae70 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojo.java @@ -413,11 +413,7 @@ public int hashCode() { private String attribute(final ForeignTojos.Attribute attribute) { final String attr = this.delegate.get(attribute.key()); if (attr == null) { - throw new AttributeNotFoundException( - String.format( - "There is no '%s' attribute in the tojo", attribute - ) - ); + throw new AttributeNotFoundException(attribute); } return attr; }