Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
albertattard committed Feb 14, 2015
1 parent 6411c91 commit 834c599
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class MediaInfo {

public static MediaInfo parse(final String data) {
public static MediaInfo parse(final String data) throws IllegalArgumentException {

final MediaInfo mediaInfo = new MediaInfo(data);

Expand Down Expand Up @@ -57,7 +57,7 @@ private MediaInfo(final String rawData) {
this.rawData = Objects.requireNonNull(rawData);
}

private Section addSection(final Section section) {
private Section addSection(final Section section) throws IllegalArgumentException {
final String name = section.getName();
if (sections.containsKey(name)) {
throw new IllegalArgumentException("Duplicate section name: '" + name + "'");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public class NameValue {

public static NameValue parse(final String line) {
public static NameValue parse(final String line) throws IllegalArgumentException {
if (!line.contains(" : ")) {
throw new IllegalArgumentException("The line is expected to have a ' : '");
}
Expand All @@ -37,7 +37,7 @@ public static NameValue parse(final String line) {
private final String name;
private final String value;

public NameValue(final String name, final String value) {
private NameValue(final String name, final String value) {
this.name = Objects.requireNonNull(name);
this.value = Objects.requireNonNull(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.Objects;

public class Section {
public static Section parse(final String line) {
public static Section parse(final String line) throws IllegalArgumentException {
if (line.contains(":")) {
throw new IllegalArgumentException("Section name should not have ':'");
}
Expand All @@ -42,7 +42,7 @@ private Section(final String name) {
this.name = Objects.requireNonNull(name);
}

public void add(final NameValue nameValue) {
public void add(final NameValue nameValue) throws IllegalArgumentException {
final String name = nameValue.getName();
if (values.containsKey(name)) {
throw new IllegalArgumentException("Duplicate name: '" + name + "'");
Expand Down

0 comments on commit 834c599

Please sign in to comment.