Remove ParserException(cause) constructor

PiperOrigin-RevId: 378635295
This commit is contained in:
aquilescanta 2021-06-10 14:17:59 +01:00 committed by Oliver Woodman
parent c728de9947
commit b5dbadee0c
5 changed files with 8 additions and 20 deletions

View File

@ -123,18 +123,6 @@ public class ParserException extends IOException {
this(message, /* cause= */ null, /* contentIsMalformed= */ true, C.DATA_TYPE_UNKNOWN);
}
/**
* Creates a new instance.
*
* @param cause The cause for the exception.
* @deprecated Use a factory method which initializes {@link #contentIsMalformed}, and {@link
* #dataType} instead.
*/
@Deprecated
public ParserException(Throwable cause) {
this(/* message= */ null, cause, /* contentIsMalformed= */ true, C.DATA_TYPE_UNKNOWN);
}
protected ParserException(
@Nullable String message,
@Nullable Throwable cause,

View File

@ -1464,7 +1464,7 @@ public final class DashMediaSource extends BaseMediaSource {
}
return timestampMs;
} catch (ParseException e) {
throw new ParserException(e);
throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
}
}
}

View File

@ -103,7 +103,7 @@ public class DashManifestParser extends DefaultHandler
}
return parseMediaPresentationDescription(xpp, uri.toString());
} catch (XmlPullParserException e) {
throw new ParserException(e);
throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
}
}

View File

@ -240,7 +240,7 @@ import java.util.List;
int speedDivisor = 1 << (speedMode - 1);
segments.add(new SlowMotionData.Segment(startTimeMs, endTimeMs, speedDivisor));
} catch (NumberFormatException e) {
throw new ParserException(e);
throw ParserException.createForMalformedContainer(/* message= */ null, /* cause= */ e);
}
}
return new SlowMotionData(segments);

View File

@ -74,7 +74,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
new SmoothStreamingMediaParser(null, uri.toString());
return (SsManifest) smoothStreamingMediaParser.parse(xmlParser);
} catch (XmlPullParserException e) {
throw new ParserException(e);
throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
}
}
@ -253,7 +253,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
throw new ParserException(e);
throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
}
} else {
return defaultValue;
@ -266,7 +266,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
throw new ParserException(e);
throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
}
} else {
throw new MissingFieldException(key);
@ -280,7 +280,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
try {
return Long.parseLong(value);
} catch (NumberFormatException e) {
throw new ParserException(e);
throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
}
} else {
return defaultValue;
@ -294,7 +294,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
try {
return Long.parseLong(value);
} catch (NumberFormatException e) {
throw new ParserException(e);
throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
}
} else {
throw new MissingFieldException(key);