Skip to content

Commit f50d111

Browse files
jonathanihmpivovarit
authored andcommitted
BAEL-1068 (eugenp#3456)
* BAEL-1068 - Javadoc example classes * BAEL-1068 - Formatting change for pom.xml * Updated javadoc comments to reflect article example * Added javadoc tags for throws, deprecated, and version and a clause to throw an exception
1 parent 9bbbe54 commit f50d111

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎core-java/src/main/java/com/baeldung/javadoc/SuperHero.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ public class SuperHero extends Person {
2323
* @return the amount of health hero has after attack
2424
* @see <a href="http://www.link_to_jira/HERO-402">HERO-402</a>
2525
* @since 1.0
26+
* @deprecated As of version 1.1, use . . . instead
27+
* @version 1.2
28+
* @throws IllegalArgumentException if incomingDamage is negative
2629
*/
27-
public int successfullyAttacked(int incomingDamage, String damageType) {
30+
public int successfullyAttacked(int incomingDamage, String damageType) throws Exception {
2831
// do things
32+
if (incomingDamage < 0) {
33+
throw new IllegalArgumentException ("Cannot cause negative damage");
34+
}
2935
return 0;
3036
}
3137

0 commit comments

Comments
 (0)